• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Session timeout problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


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

if session == null then redirect to some page(jsp) with message
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use setMaxInactiveInterval(int seconds) and in the next page check if session.isNew() if yes process if no proceed.
 
HarshalDilip Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic