File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes session values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session values" Watch "session values" New topic

session values

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi all, i'm new to jsp. just wondering if i can set the timeout value of a session.
Manoj Karnavat

Joined: May 08, 2001
Posts: 3
yes , there is a method

where int is the number of seconds for which the session will be valid..
i hope your query is solved
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

The short answer is 'Yes, you can'.
The slightly longer answer is that sessions are managed by the servlet container and therefore the way you actually configure the session timeout is specific to a particular Application Server.
One way you can assist this is to write the current Date/Time on the session on each page hit, then test this value when they hit the next page.
I agree. Here's the link:
subject: session values
It's not a secret anymore!