Well, that has nothing to do with history. You need to manage the state of your application properly. You can try to play with onbeforeunload
Create a session variable which keeps your login state. Hook a webservice call to
event, which would clear the session information once you navigate to any other url.
Hope this helps!