Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Tracking thro HttpSession

 
Shantanu Gangakhedkar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using HttpSession object in my project.When I use two browser Instances on same machine the same session is shared betn two instances. Dose it mean that u can not use multiple sessions on a single machine at the same time?
I want to Open Different Session for the Different Instances on Same MAchine. I also want to seprate the Data between two diff Sessions on the Same Machine.
Please tell me how to do it with some sample code
Thanx in Adv
Reply
Shantanu.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is browser-dependent behaviour. It is a grey area in the HTTP spec whether cookies should be shared between all browser windows, or only available to the window which received the cookie. Most current browsers share the cookies in the same way that they share the cached pages.
To ensure that separate windows use separate sessions you will need to use the URL-rewriting method of session id storage, rarher than cookies. It's clumsy, but it does work. As for sample code, look for the examples of sessions without cookies in any Servlet book.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic