• Post Reply Bookmark Topic Watch Topic
  • New Topic

about session  RSS feed

 
david hu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not quite understand when the session begins and ends.
It's said in one book:
A session starts when the browser makes the first request for a JSP page in a particular application.
The session can be ended explicitly by the application, or the JSP container can end it after a period of user inactivity.
The above paragraphs are quoted from a jsp book,But I think it should applied to servlet.
My question is:
(1)Suppose I use my brower to connect to a jsp application, now the session begins. If later I connect to another web site, and connect to the previous jsp application again, will the server treat it as the same session or different session?
(2)Suppose I first connect to a jsp application, now the session begins. If I use Ctrl+N to open a new browser window and browse at this new window but still connect to the same jsp application, will the server treat it as the same session?
(3)Suppose I first connect to a jsp application, then I turn down my computer or just close the browser and then turn on my computer and browse the same jsp application again, will the server treat it as the same session?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) Same session, unless it has timed-out in the meantime.

(2) Same session, as long as you are using the same browser. I've heard people say IE uses a separate session if they launch IE again (ie: do not use Ctrl-N, relaunch the browser). Haven't tested this myself.

(3) Different session. Sessions are (mostly) implemented as a cookie. Once the browser is closed, the cookie goes away.
[ February 27, 2002: Message edited by: Mike Curwen ]
 
david hu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your reply!
It's very helpful to me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!