Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Will the container take care with session tracking

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers.
As you know guys, in session tracking we may use cookies or url rewritten.
and in JSP and Servlets we can use session object to store our information.
in java web application, should we care if the client disabling cookies ( I mean, will the container
take care with this situation?)
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It'll take care only if you use endodeURL of HttpServletResponse interface:
String encodeURL(String url)
String encodeRedirectURL(String url) // to be used for sendRedirect API.
Example:
response.encodeURL("/servlet/AnyServlet");
You don't have to worry whether the browser has disable cookies or not. This will save you
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...depending on the server.
Some application servers (eg WebSphere) require you to explicitly allow session tracking by URL rewriting in the web context settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic