Originally posted by Asher Tarnopolski:
if i remember right, it depends on the browser preferences. the servlet tries to set cookies but if they are disabled in browser it moves to session tracking stuff with urlencoding.
read more here:
http://csajsp-chapters.corewebprogramming.com/CSAJSP-Chapter9.pdf
Sort of. URL rewriting must be done in the
JSP in order to pass the session id. i.e. for a link to "myJsp.jsp" the session ID is not appended unless you use URLEncoder.encode("myJsp.jsp") to write the link. At that point, it is up to the servlet engine to determine how to encode it. In WAS, you either enable or diable URL encoding. With it enabled, the resulting link is something like "myJsp.jsp;ab234alkj2349023" which the browser understands is a session ID to pass back to the server.
If a browser has cookies 100% disabled and you don't use URL rewriting, the user will get a new session every time.
The
Struts html:link tag takes care of all this for you, so if you need to maintain session across pages, it's a lot easier to use this tag
<html:link href="myJsp.jsp">link</a>
than
<a href="<%=URLEncoder.encode("myJsp.jsp")%>">link</a>
every time you create a link.