Close all popup if lose the session

Close all popup if lose the session

hello community!

How do I close all popup application if you lose the session?


Hi Eduardo,

By definition, losing session means that the client has not made requests to the server in a while.
The consequence is that you cannot execute logic on the server to do something when this happens.

If you know how much time a session lasts in your application server, then it is possible for you to implement some javascript that after that timeframe closes the pop-up.

Instead of doing that, you might consider just displaying a message to the users notifying that "Your session is about to expire, please save your work."
Imagine that you are making a transfer in your home banking web site. You take sometime filling-in the data, and then the pop-up closed without telling you anything, and you lost the information you had input. If you don't like this, you should also  avoid doing the same to your users :)
Hi Eduardo

If you want to prevent the "Session Lost" page to be open in a popup, you should add some javascript to your page (tipically the page where Security exceptions points to).
This javascript then checks if the page is in an iFrame, and if so, closes the popup and opens the page in the top window.

I used this js inside the RunJavascriptAction from HTTPRequestHandler extension, from the preparation of the page:

"if(top != self) {
 top.onbeforeunload = function() {};

hope this helps

António Barroso