Is there a way to update the status of a login when we go backward in an application

javascript, jquery

Solution

The problem with browsers is that using the back button doesn't refresh the page to any data form a server or force the browser to run any loading JavaScript functions.

What you could do is have a JavaScript function set on a time-out to check if they are logged in every 10 seconds using AJAX.

I wouldn't bother though as you are adding additional server load for no real benefit, as when the user refreshes the page or clicks on a link they would still be logged out and wouldn't be able to perform any logged in actions.

Problem

Currently I'm logging into my account. After proceeding some of the pages I have log-out my account. Now if I go back page using back button in browser, still I'm in login state. Is there anyway to set this status as logout?

Original source