I'm making a static HTML demo that emulates the behavior of a web portal that logs you out when you press the back button.
How might one do this using javascript? Is it possible?
I'm making a static HTML demo that emulates the behavior of a web portal that logs you out when you press the back button.
How might one do this using javascript? Is it possible?
It is generally considered bad form to override the behavior of the Back button.
You can use cookies to send a value between pages. For the demo, the logout page could set a "LoggedOut=1" cookie. Then in the top of all of your site's pages, have javascript that checks for the cookie. If set, redirect the user to the home page. The trick is that you have to use javascript to handle the redirect since the script has to already be in the user's browser cache.
Note that this doesn't add any security to the app. It just adds a layer of obfuscation.