Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do Session get invalidated when we close the browser

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Buddies,

Do Session get invalidated when we close the browser?

How long does the cookie JSESSIONID live...?

That should be out question...
Because the session id is the key for tracing back the original session...

am i correct...

please give your views?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the server has no idea that a browser window has been closed.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How long does the cookie JSESSIONID live...?


That depends on the cookie's age. -1 signifies infinity. The session does not die when you close the browser
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session are objects created at the container.untill you explicitly invalidate them or they timeout , untill then they remain in the server.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
afaik, in Tomcat default timeout was 30 minutes = (30*60*1000=180000 milliseconds)
Under xxx-config.xml, for the server of tomcat, one should have entered this value in milliseconds, as 180000.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends...

Thanks for all your response..

That depends on the cookie's age

How can set the age of JSESSIONID cookie?
if it is custom cookie, of course with-- setMaxAge(milliSec)..
But JSESSIONID is maintained with the container?
And setMaxInactiveInterval(milliSec).. only set the age for the session object at the server end

Session are objects created at the container.untill you explicitly invalidate them or they timeout , untill then they remain in the server.

Rahul, you are correct...

So can i come to a conclusion that closing a browser doesn't have anything to do with the session...even the cookie related to sessionID(JSESSIONID cookie...........)

Thanks again for the reply posts
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Theepan Thevathasan:
Hi Friends...

Thanks for all your response..

Rahul, you are correct...

So can i come to a conclusion that closing a browser doesn't have anything to do with the session...even the cookie related to sessionID(JSESSIONID cookie...........)

Thanks again for the reply posts



Yes , browser close is not related to the HTTPSession objects created in the container , as the container would not know that the browser has been closed in the client end.but JSESSIONID is related to this issue as JSESSIONID is used to track requests from a single session.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tk Rahul,

Thanks for the replies...

I am clear now..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic