Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to return to self page after clicking Confirm box OK button

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have designed a code of SessionFilter in jsp Spring application and i kept 5 minutes of Session timeout period. I want to display a confirmation message to user before 30 seconds of timeout saying "Your Session is going to expire in another 30 Second. Do you want to continue." If user clicks Cancel button, the flow has to navigate to Login page and if the user clicks OK button, the page should stay in same page keeping session variable alive.

Below javascript code i used to stay in same page after user clicks OK button of Confirm box but it not not working as expected.


function notifyUser()
{
setTimeout(function() {
var timeLeft = confirm('Your Session is going to expire in another 30 Second. Do you want to continue.');
if(timeLeft == true)
{
window.location = self.location.reload(true);

}
else
{
window.location = 'index.jsp';
}
}, 30000);
}

<body onLoad="notifyUser()">

</body>


Please suggest how to do this.

Thanks you,
Shwetha.
 
Shwetha Jagadish
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please find the formatted code below,

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
useinstead of using

and does refreshing the page invalidate the session?
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic