Can I restart a jsp session from a javascript?

M

mohammed.naghman

Hi,

I have a jsp page with the maxInactivity timeout set to 120 seconds.


I also have a javascript that shows a warning to the user when one more

minute is left for the session to expire.


I want to give the user an option to renew his session.


How can I do this?
 
J

Joe Attardi

I have a jsp page with the maxInactivity timeout set to 120 seconds.
I also have a javascript that shows a warning to the user when one more
minute is left for the session to expire.
I want to give the user an option to renew his session.
How can I do this?

You can write some JavaScript code to send the browser to a servlet or
action that renews the session (or something as simple as refreshing
the page), with a confirm dialog of some kind.
 
M

mohammed.naghman

Joe said:
You can write some JavaScript code to send the browser to a servlet or
action that renews the session (or something as simple as refreshing
the page), with a confirm dialog of some kind.

I tried refreshing the page and it works. But the problem is, the page
that I am trying to refresh is a form so for the scenario where the
user has filled half the form and then goes idle and the session times
out, then on refreshing the entered values will be cleared.

I just want to give the user to renew the session. Can I do it without
refreshing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top