views:

3146

answers:

2

Hi to everyone. I am new in asp.net, My problem is facing logout problem in myappication using master page and window authentication. After i signout from my application if i use browser back button it again goes back to signed page after that i click any control then only it is goes back to the logout stage but i want to dont show the logged page unnessarily.

i am using href,document.location.replace(page),response.write("mypage.aspx") these technique for naviagation purpose and i am using session in all pages.

Note: I am using login and logout in master page top itself...so if i check the session for null redirect to home page which is also a content page then i am not getting the home page it self to login because infinite looping occurs...

when i am searching i got some coding to clear the cache but i a am facing problem that is after i logged and navigate to some of pages then i click browser backbutton without signout it is showing page is expired Click refresh to get the data back....

Finally, I need solution like google signout i.e: after signout from google page then if we use back it shows only the home page. and please tell which event is fired while clicking the browser backbutton if yes how to validate session and redirect to logout page.

Please help me i am facing these problem in one-week....

Thanks in advance to everyone..

A: 

You could consider in the Masterpage Page_Load to check for login credentials (however they are implemented in your solution) and if they are not present, to Response.Redirect() to the login or home page.

Edit: I'm not sure whether the OnLoad event is raised when using the back button. This approach may not work.

StuperUser
+1  A: 

Easiest way to resolve this problem is to disable the cache of the page.

This should help you out.

James