This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Session timeout problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
}
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic