aspose file tools*
The moose likes Servlets and the fly likes Can 2 session exist at the same time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can 2 session exist at the same time?" Watch "Can 2 session exist at the same time?" New topic
Author

Can 2 session exist at the same time?

Moses Herrada
Greenhorn

Joined: Jan 22, 2005
Posts: 11
Can 2 http session exist at the same time? or sessions can be multiple ??
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can 2 session exist at the same time?
 
Similar Threads
Session in Distributed Environment
session migration
Creating new Session without invalidating current session
session in the distribution application
Session Invalidate -- Many ways