Preventing back button after loggin out?
-
Hi all, I have developed an applciation where i have placed a log out link in the master page which redirects to a lout.aspx page where i have placed in the code behind the following code: Session.RemoveAll() Response.Redirect("~/Default.aspx") I am being redirected to the login page but when i press back from the back button in IE7 iam being able to see the last page the user was logged in. How can i prevent that taking into consideration that i dont want to delete the back button in all the web pages, however i need to disable it in the login.aspx page only. P.S. I have tried the JS
<script language="javascript">history.forward(1);</script>
in the Login.aspx page. thanks
-
Hi all, I have developed an applciation where i have placed a log out link in the master page which redirects to a lout.aspx page where i have placed in the code behind the following code: Session.RemoveAll() Response.Redirect("~/Default.aspx") I am being redirected to the login page but when i press back from the back button in IE7 iam being able to see the last page the user was logged in. How can i prevent that taking into consideration that i dont want to delete the back button in all the web pages, however i need to disable it in the login.aspx page only. P.S. I have tried the JS
<script language="javascript">history.forward(1);</script>
in the Login.aspx page. thanks
-
Hi all, I have developed an applciation where i have placed a log out link in the master page which redirects to a lout.aspx page where i have placed in the code behind the following code: Session.RemoveAll() Response.Redirect("~/Default.aspx") I am being redirected to the login page but when i press back from the back button in IE7 iam being able to see the last page the user was logged in. How can i prevent that taking into consideration that i dont want to delete the back button in all the web pages, however i need to disable it in the login.aspx page only. P.S. I have tried the JS
<script language="javascript">history.forward(1);</script>
in the Login.aspx page. thanks
There is no reliable way to stop this. You are seeing a browser cached page when you press back button. If you are sure that all session is removed and user can't proceed without valid session, why you are bothering? You should check the session existence each time page refreshes. So users won't be able to continue using secured data after logging out.
Navaneeth How to use google | Ask smart questions
-
Hi all, I have developed an applciation where i have placed a log out link in the master page which redirects to a lout.aspx page where i have placed in the code behind the following code: Session.RemoveAll() Response.Redirect("~/Default.aspx") I am being redirected to the login page but when i press back from the back button in IE7 iam being able to see the last page the user was logged in. How can i prevent that taking into consideration that i dont want to delete the back button in all the web pages, however i need to disable it in the login.aspx page only. P.S. I have tried the JS
<script language="javascript">history.forward(1);</script>
in the Login.aspx page. thanks
samerh wrote:
Session.RemoveAll()
Always Use
Session.Abandon()
For Logout.cheers, Abhijit
-
There is no reliable way to stop this. You are seeing a browser cached page when you press back button. If you are sure that all session is removed and user can't proceed without valid session, why you are bothering? You should check the session existence each time page refreshes. So users won't be able to continue using secured data after logging out.
Navaneeth How to use google | Ask smart questions
-
I am checking if the session is still alive however the page is still displayed when i press back button. But if i refresh the page it will redirect me out again.
samerh wrote:
But if i refresh the page it will redirect me out again.
Yeah, this is enough. So no need of nasty JS to block back button. :)
Navaneeth How to use google | Ask smart questions
-
samerh wrote:
But if i refresh the page it will redirect me out again.
Yeah, this is enough. So no need of nasty JS to block back button. :)
Navaneeth How to use google | Ask smart questions
-
Hi all, I have developed an applciation where i have placed a log out link in the master page which redirects to a lout.aspx page where i have placed in the code behind the following code: Session.RemoveAll() Response.Redirect("~/Default.aspx") I am being redirected to the login page but when i press back from the back button in IE7 iam being able to see the last page the user was logged in. How can i prevent that taking into consideration that i dont want to delete the back button in all the web pages, however i need to disable it in the login.aspx page only. P.S. I have tried the JS
<script language="javascript">history.forward(1);</script>
in the Login.aspx page. thanks
why shouldnt you use xml scripting of page expired,session expires or proper using of session ["value"]=null; session.abandon(); this will help you to prevent your page after logout and also **use this codesnippet in masterpage is usefull in security**. bye