The Artima Developer Community
Sponsored Link

Java Answers Forum
Setting sessions to never expire

2 replies on 1 page. Most recent reply: Jun 4, 2003 7:34 AM by Clark D Richey, Jr.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Clark D Richey, Jr.

Posts: 4
Nickname: cdrichey
Registered: Jun, 2003

Setting sessions to never expire Posted: Jun 3, 2003 8:08 AM
Reply to this message Reply
Advertisement
According to the Servlet specification, session can be set to never timeout by setting the timeout period to -1.

If the session never times out then the only time the session object should be garbage collected is if the user explicitly logs off the system. Doesn't this present a situation where the number of session objects being persisted on the server could grow without bound until the server itself crashed? I imagine that this would happen if users consistently exited the application by closing the browser instead of using the application's logoff feature.

I hope that I have missed something as this sounds like a serious pitfall...


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: Setting sessions to never expire Posted: Jun 4, 2003 4:25 AM
Reply to this message Reply
> According to the Servlet specification, session can be set
> to never timeout by setting the timeout period to -1.
>
> If the session never times out then the only time the
> session object should be garbage collected is if the user
> explicitly logs off the system. Doesn't this present a
> situation where the number of session objects being
> persisted on the server could grow without bound until the
> server itself crashed? I imagine that this would happen if
> users consistently exited the application by closing the
> browser instead of using the application's logoff
> feature.
>
> I hope that I have missed something as this sounds like a
> serious pitfall...

closing the browser window closes the session as well.

Clark D Richey, Jr.

Posts: 4
Nickname: cdrichey
Registered: Jun, 2003

Re: Setting sessions to never expire Posted: Jun 4, 2003 7:34 AM
Reply to this message Reply
No. That is the problem. The server has no way of knowing that the browser was closed unless you implement some sort of clever client side monitor.

Flat View: This topic has 2 replies on 1 page
Topic: what is the use of apache server Previous Topic   Next Topic Topic: Runtime.exec GUI

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use