Hi all,
 
Using Tomcat 4.1.18, I am getting (what I believe) is inconsistent behaviour
with respect to session handling.  Hopefully someone here can clear this up
for me.
 
Running Tomcat Standalone on my local machine, if I go into my browser, and
go to http://mattm:8080/myapp/index.jsp, it uses a Struts redirect I have
set up to take me to the welcome page for my app, except it appends the
jsessionid on it (so I end up going to
http://mattm:8080/myapp/Welcome.do;jsessionid=******************)
 
Now, If I immediately go back to the URL and enter in the exact same URL
again (without closing the browser) (i.e. go back and put in
http://mattm:8080/myapp/index.jsp), once again I am forwarded to the welcome
page for my app, but it does NOT contain the jsessionid, which I assume
means that it's storing the session in a cookie.  Subsequently, if I keep
accessing the site, the jsessionid is never appended to the URL again.
(Until i close the browser, of course -- which I realize should reset the
session id)
 
In my context, I do have cookies="true", and I do not have cookies disabled
in my browser (as far as I know).
 
Is there a reason why the first access includes the jsessionid and does not
appear to use browser cookies?  Is it because Tomcat doesn't know if my
browser supports cookies yet?  Is there a way to force the page to load with
cookies immediately? (By following another redirect or something).  I don't
want to disable support for cookie-disabled browsers -- I just want to see
if I can support cookie-enabled browsers better by not appended the
jsessionid in every URL.  (The reason I want to get rid of the jsessionid if
possible is because the 'Welcome' page (not index.jsp, but the page it
forwards to) is a Logon page, and if the user bookmarks that page with the
jsessionid in it, IE won't remember their username and password for the
future -- minor annoyance, but it'd be great if it could be fixed.)
 
 
Thanks for your help,
Matt Mejaski

Reply via email to