hi guys how do i make sure after i click logout and if i were to press the "back" on the web explorer it wont save the session instead it will either show me a error message or bring me to login page?
at my login.aspx i put this codes in pageload part but it still does not work can someone help me take a look?
it does redirect to the login page but when i press the "back" on the web explorer i still can access the web with my login. can someone help me thanks
erm i do not want to disable my back button arun . i wan to destroy the session kept that is after login till i press logout everything will get destroy it short after u press logout if u press " back " it wont go back to the previous page it will show a
error message or redirect you to login page that request you to login again.
am still not sure i follow the blog link and tried the steps but i have a error that a guy also had it in the blog but no solution is given. which is the Now()-1 is underlined wif error.
i managed to clear the session aready but problem is am still able to back to previous page even after logout but the session is no longer there. meaning i can still go to edit profile page after logout which is not suppose to anyway to restrict it???
hi guys my problem persist i need to solve it anyways to solve it ?
i managed to clear the session aready but problem is am still able to back to previous page even after logout but the session is no longer there. meaning i can still go to edit profile page after logout which is not suppose to anyway to restrict it???
None
0 Points
46 Posts
regarding session destroy. (logout)
Oct 05, 2011 02:10 AM|gaara|LINK
hi guys how do i make sure after i click logout and if i were to press the "back" on the web explorer it wont save the session instead it will either show me a error message or bring me to login page?
at my login.aspx i put this codes in pageload part but it still does not work can someone help me take a look?
it does redirect to the login page but when i press the "back" on the web explorer i still can access the web with my login. can someone help me thanks
Member
632 Points
329 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 02:22 AM|v.arunkarthik|LINK
http://csharpdotnetfreak.blogspot.com/2009/04/disable-browser-back-button-javascript.html
http://forums.asp.net/t/989339.aspx/1
karthik..
Please mark as Answer if it helps. !!???
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 02:28 AM|gaara|LINK
erm i do not want to disable my back button arun . i wan to destroy the session kept that is after login till i press logout everything will get destroy it short after u press logout if u press " back " it wont go back to the previous page it will show a error message or redirect you to login page that request you to login again.
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 02:29 AM|iGulfam|LINK
Please go through the following link
http://issuesdotnet.blogspot.com/2010/08/disable-browser-back-button.html
My BLOG
Participant
891 Points
408 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 02:44 AM|jassi_singh|LINK
Hello,
You need to check session on back button or write session.abandon() in application_end event in global.asax file
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 02:56 AM|gaara|LINK
am still not sure i follow the blog link and tried the steps but i have a error that a guy also had it in the blog but no solution is given. which is the Now()-1 is underlined wif error.
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:05 AM|iGulfam|LINK
I have updated the BLOG to over come the above error. Please have a look or use
Response.ExpiresAbsolute = DateTime.Now().AddDays(-1)
at the place of
Response.ExpiresAbsolute = Now()-1
My BLOG
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:10 AM|gaara|LINK
hey i have changed to ur updated 1 but stil the same problem.
Response.ExpiresAbsolute =DateTime.Now().AddDays(-1);
in my coding this is underlined with error .
the error message :
Non-invocable member'System.DateTime.Now'cannot be used like a method
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:13 AM|iGulfam|LINK
You must be using C#.
Use following code
My BLOG
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:32 AM|gaara|LINK
i added 3 line of html codes in the html pages and its having errors
Error 1 Only Content controls are allowed directly in a content page that contains Content controls.
yes am using C# and ur codes solve aready but am having the above errors thank you
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:39 AM|iGulfam|LINK
I guess you are using Master Pages? If yes then use those three lines in <head> secion of your Master Page :)
Glad that my solution worked for you. Please don't forget to Mark the Post as answer if it has helped you.
My BLOG
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:53 AM|gaara|LINK
sorry ah i do not understand <head>section of my master page.
can u be more specific?
below is my code of html that i want the page to clear session
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:57 AM|iGulfam|LINK
Your Default.Master page will be having following (or similar) section. See in code where I have added those three lines.
My BLOG
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 03:59 AM|gaara|LINK
i have put aready but i can still back =.= sighh
Contributor
3078 Points
941 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 04:01 AM|iGulfam|LINK
What about the other code? I mean the code which you have to put in Codebehind.
Have you followed the BLOG post fully?
My BLOG
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 05, 2011 10:13 PM|gaara|LINK
yup i have
this is under pageload
i managed to clear the session aready but problem is am still able to back to previous page even after logout but the session is no longer there. meaning i can still go to edit profile page after logout which is not suppose to anyway to restrict it???
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 11, 2011 10:44 PM|gaara|LINK
hi guys my problem persist i need to solve it anyways to solve it ?
i managed to clear the session aready but problem is am still able to back to previous page even after logout but the session is no longer there. meaning i can still go to edit profile page after logout which is not suppose to anyway to restrict it???
None
0 Points
46 Posts
Re: regarding session destroy. (logout)
Oct 12, 2011 10:23 PM|gaara|LINK
anyone can help me thanks