Answered by:
log out problem

Question
-
Hello guys,,
in my web based application i have a logout button on every page i go ok.. but wen i go in any page and click the logout button i have made login screen appear again which is correct but if i click on the back (arrow) button which is present on the toolstrip menu on the browser it navigates back to the same page inside my application where i was previously.. i want the login screen oly to remain der eventhough i clik the bac buttonSaturday, February 14, 2009 6:22 AM
Answers
-
Ashwin,
The cause for this to happen is that the javascript is executed to go back to the previous page.
So, the Page Load event doesnt fire every time you click "Back" button in the browser.
I am not sure which version of ASP.NET you are using.
But you can try code in this link based on your scenario -
http://www.4guysfromrolla.com/webtech/111500-1.shtml
Let me know if it helps...
Regards,
Pai
Gautham S Pai | Posting is provided "AS IS" with no warranties, and confers no rights.- Marked as answer by Michael Sun [MSFT]Microsoft employee, Moderator Wednesday, February 18, 2009 10:23 AM
Saturday, February 14, 2009 10:52 AM -
Hello,
Another option rather than disabling the Back button which is not only extremely annoying to users but can be worked around is to check the users security status in the Page_Load event of every page. To oversimplify what we do is create an object (class) when the user logs in that encapsulates all their security/user info. If the users logs out or times out the object is destroyed. We inspect the object on page load if it is null we redirect to the login page. This type of structure can be used to greatly extend your security.
Regards,
Jeff- Proposed as answer by JeffWask Tuesday, February 17, 2009 5:37 PM
- Marked as answer by Michael Sun [MSFT]Microsoft employee, Moderator Wednesday, February 18, 2009 10:23 AM
Tuesday, February 17, 2009 5:30 PM
All replies
-
Ashwin,
The cause for this to happen is that the javascript is executed to go back to the previous page.
So, the Page Load event doesnt fire every time you click "Back" button in the browser.
I am not sure which version of ASP.NET you are using.
But you can try code in this link based on your scenario -
http://www.4guysfromrolla.com/webtech/111500-1.shtml
Let me know if it helps...
Regards,
Pai
Gautham S Pai | Posting is provided "AS IS" with no warranties, and confers no rights.- Marked as answer by Michael Sun [MSFT]Microsoft employee, Moderator Wednesday, February 18, 2009 10:23 AM
Saturday, February 14, 2009 10:52 AM -
Hello,
Another option rather than disabling the Back button which is not only extremely annoying to users but can be worked around is to check the users security status in the Page_Load event of every page. To oversimplify what we do is create an object (class) when the user logs in that encapsulates all their security/user info. If the users logs out or times out the object is destroyed. We inspect the object on page load if it is null we redirect to the login page. This type of structure can be used to greatly extend your security.
Regards,
Jeff- Proposed as answer by JeffWask Tuesday, February 17, 2009 5:37 PM
- Marked as answer by Michael Sun [MSFT]Microsoft employee, Moderator Wednesday, February 18, 2009 10:23 AM
Tuesday, February 17, 2009 5:30 PM