I'm writing a web app with multiple jsp files wit a session timeout of 20 min.
But in a specific jsp when i call an action i need to set the session timeout bigger. I use:
request.getSession().setMaxInactiveInterval(1800);
Then one the action it's ended i reset the session timeout to it's original value with:
request.getSession().setMaxInactiveInterval(600);
But when running the app, and calling the action, one it ends the session close 'cause the time i set have already passed.
What i want to know is if there is a way no know when i exit jsp? not closing the brower or closing the tab windows. For example, i call another jsp?.
Or is another way to resert the session timeout so the session doesn't close when the action end?
I forgot. The action is inside a for bucle and if a condition if true the action if called. And i put the code changing the session timeout before calling the action and reset the time when the action ends.
for(int i = 0; i < totalreg; i++) {
if (condition) {
request.getSession().setMaxInactiveInterval(1800);
process();
request.getSession().setMaxInactiveInterval(600);
}
}
Thanks.