You really typically don't want to attempt to alter the default behavior involved with the browser's back button (as this is purely client-side and specific to the browser). You should consider adding some form of authentication to your application
like Forms Authentication which will allow your users to login and then you can add the necessary security within your application to ensure that only authenticated users can access specific
areas.
Forms Authentication basically will create a browser cookie (Authentication Token) when your user logs in and this will be used to signify that the user has authenticated in your application. When you want the user to log out, you can simply call
the FormsAuthentication.SignOut() method :
FormsAuthentication.SignOut();
When you combine requiring this authentication in your pages along with removing the cache, this will ensure that when the back button is pressed after a user logs out, that they will be forced to log back in.
All-Star
114593 Points
18503 Posts
MVP
Re: browser back and document expired message
Apr 25, 2014 02:09 PM|Rion Williams|LINK
You really typically don't want to attempt to alter the default behavior involved with the browser's back button (as this is purely client-side and specific to the browser). You should consider adding some form of authentication to your application like Forms Authentication which will allow your users to login and then you can add the necessary security within your application to ensure that only authenticated users can access specific areas.
Forms Authentication basically will create a browser cookie (Authentication Token) when your user logs in and this will be used to signify that the user has authenticated in your application. When you want the user to log out, you can simply call the FormsAuthentication.SignOut() method :
When you combine requiring this authentication in your pages along with removing the cache, this will ensure that when the back button is pressed after a user logs out, that they will be forced to log back in.