You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jagadeesha T <ja...@yahoo.com> on 2005/03/30 06:58:17 UTC

Session Handling

Hi all,
I need to launch a browser from a java application (swing) on the click of the button.
Each click should launch a different instance of the browser. However, all these instances of the browser should share the same HttpSession (created on the launch of the first browser instance).

Currently, have implemented this by setting a cookie in HttpServletResponse object.
 
response.addCookie(new Cookie("jsessionid",sessionid)) 
response.sendRedirect(NextPage),
 
 In the above approach, all browser instances share the same session. This works fine. 
 However, if the jsp invoked as part of sendRedirect uses response.encodeURL(), this approach does not work. When the encoreURL() method is used, the session id is not set correctly (a different session id is being set). Not sure how/why the session id is different in this case. 
 
 Any idea why?
 Or is there any other way of sharing a session for all the browsers.
  I am using Tomcat version 5.0,
  
 Thanks,
 Jagadeesha T
 
 
 
 
 

		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Easier than ever with enhanced search. Learn more.