Since the iframe doesn't know that the user isn't authenticated anymore, it has to be told from the outside. There is no real good way to solve this without notifying the
You could put some javascript on the page with the iframe, that checks at regular intervals if the user still authenticated. If no, reload the page or just the iframe.
Pseudo javascript code:
function reloadFrameAtLogout () {
if(!isAuthenticated()) iframeWindow.location="Someurl";
setTimeout("reloadFrameAtLogout ()", 1000);
}
You have a few options for isAuthenticated, e.g.:
a) Set a cookie at login, destroy it at logout: Read that cookie in isAuthenticated. If it is there, user is still logged in. This option is not very safe, but will probably work in most scenarios and is very fast.
b) Make an ajax call to some protected url. When the request fails, you are not authenticated anymore. Very safe, but generates a lot of requests.
You can probably also combine these options: Test the cookie every couple of seconds and do a full test with an ajax call every minute or so.
Please sign in to flag this as inappropriate.