If user logged in to gmail account and then he clicks the browser back button, the page refreshes again.
You can’t disable the back button. What happens when it looks like that just refreshes the current page is that there is that the prior page automatically redirects to the current one and so what you thought was the immediate previous page is actually back two. So when the page refreshes like that you simply select the dropdown next to the back button and select to go back two pages instead of one.
hi, thank u for u r reply
can u tell me, how to sign out when user clicks the back button in PHP
You can’t disable the back button in browsers but you can do tricks to prevent people from using the back button to go the previous page and you do it by simply not creating any history in the browser. You can do it like this:
You can use the trick 2 above to accomplish that but you need to make sure there is an intermediate page somewhere to which the back button will always direct. But there is no way you can do that if someone goes back a few pages back in history like felgall said. The best you can do is apply a timeout so that users are signed out after a few minutes of inactivity.
@Lemon Juice:Thank for u r reply.
I place the following code in the <body> tag window.location.href=“page itself”; . It refreshes the page again(This is my expected behaviour, like google does in the gmail)
It is working fine in Firefox and IE. But window.location.href not working in safari and chrome.