aspose file tools*
The moose likes JSP and the fly likes Session timeout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Session timeout problem" Watch "Session timeout problem" New topic
Author

Session timeout problem

kasthala shyam
Greenhorn

Joined: Jun 14, 2008
Posts: 3
Hi all,

We have an application where we have to disable the cookies and use url-rewriting. i want the user to invalidate after some specified time. i have given the <session-timeout> parameter in my web.xml file.

<session-timeout>1</session-timeout>

i have given the value as 1 which means 1 minute. when i click the logout link on the particular jsp page (index.jsp) then i am logging out but i want the user to invalidate when i click on any other link on the page after the session expires (i.e., after 1 minute). But i am not able to invalidate after 1 minute.
Can anyone tell me what should i do?
Thanks in advance.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi,


fine...then please check the session in next page(the link page),

if session == null then redirect to some page(jsp) with message
HarshalDilip Shah
Greenhorn

Joined: Feb 25, 2010
Posts: 5
Use setMaxInactiveInterval(int seconds) and in the next page check if session.isNew() if yes process if no proceed.
HarshalDilip Shah
Greenhorn

Joined: Feb 25, 2010
Posts: 5
This is my assumption. You must be having a log out page and one correct page.
If the session is still active when you click on link you should go to correct page
else go to logout page/invalid page. Right?
Then this is the solution.
session.setMaxInactiveInterval(int seconds)
.
.
link.....

At the begning of new page
if (session.isNew())
{
redirect to invalid page
}
else
{
continue with this page
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session timeout problem
 
Similar Threads
Browser timeout OR session timeout
Correct way to use getSession() in actions?
Prompting to relogin on timeout
session timeout not working
Session Invalidation and Timeout !