Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can 2 session exist at the same time?

 
Moses Herrada
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can 2 http session exist at the same time? or sessions can be multiple ??
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am not getting the question is in which context. Serveral sessions are exist in container. For the user , usually there is only one session per ServletContext ( application).

It is possible that there may be more than one session per user per application, if the brwoser on the client machine is running in seperate thread for multiple windows and the user opens two different sessions.

I am also studying Servlet, so this may not be a perfect answer.

Thank you.

Narendra Dhande
SCJP 1.4
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Narendra has it right. Each session is associated with a unique serial number, typically stored in the user's browser as a cookie. One user with multiple browser windows open may have multiple sesssions, depending on how the browser manages cookies. A single request can have only one session associated with it. The servlet API goes to great lengths to prevent interference between sessions for security reasons.
A servlet container can be managing thousands of sessions "at the same time."
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic