• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the max age for JSESSIONID cookie. can we change it?

 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
i wanted to ask one question:


What is the default max age for JSESSIONID cookie which is created when we use session. can we modify it.
if yes then how and where is correct place to modify it.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the <session-config> element in web.xml.

For example, see this thread. Searching the web for something like "java +configure session timeout" or similar will return a lot of hits.
 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to prevent the cookie to be invalidated when user closes the browser. i want to set the JSESSIONID cookie to stay alive for say, 20 minutes, whether browser is running or closed. so when user closes the browser and reopen the browser and access the same site he can still use the same JSESSIONID to access the site.

is there any way?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's browser-specific behavior--so probably not.
 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But most sites provide that feature like mail sites, orkut etc. how they use the session even browser restarts
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many of those sites will use cookies to store the credentials so that a session can be automatically restarted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic