Last post Apr 26, 2014 11:07 AM by sultani.khalid.af
Apr 25, 2014 01:36 PM|sultani.khalid.af|LINK
i have used below code in master page load event to mange the back button once the user log out of page using asp.net membership.
Now if the user click the back button it get document expired , the document This document is no longer available message in firefox, and error in chrome.
and the user need to refresh the page.
how can i redirect the user to another page in case it click the back button and the user is already log out, so the user don't see this error message.
asp.net forum used similar approach and redirect to another page by using timer.
Apr 25, 2014 01:59 PM|Ashim Chatterjee|LINK
Dont clear the cache .. let the end user go back .. on every page pageload check the session for logged in users .. if the session is not null then he/she is already logged in .. then redirect them back to home page .
Apr 25, 2014 02:05 PM|sultani.khalid.af|LINK
Apr 25, 2014 02:09 PM|Ashim Chatterjee|LINK
if you are not using sessions for maintaining logins then what kind of authentication here we are dealing with ?? Morover you cant control the browser back button , plus its an annoying thing for an end user to restrict the back button.
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
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.
Apr 25, 2014 02:27 PM|sultani.khalid.af|LINK
Apr 25, 2014 02:30 PM|Ashim Chatterjee|LINK
Apr 25, 2014 02:44 PM|sultani.khalid.af|LINK
Apr 26, 2014 11:07 AM|sultani.khalid.af|LINK
excellent post by frez , by using timer in log out page , clearing the cache and then redirecting user to mainpage or login page.
hope it will help some one else.