actually what are the main reasons that session not completly destroy after calling the session.Abandon() ?
Best Regards
When Session.Abandon is called, the session ID cookie is not removed for the browser.
Even after Session.Abandon call, any new request to the application uses the same Session ID with new session state instance.
Please mark it as answer if it resolves the issue.
Iam using session.Abandon for killing the session . I have a login and logout page , On logout page iam going to kill the session like below
Session["Username"].Abandon();
But still iam going to back after logout it mean that session is not going to be kill.
Is there any alternative ?
Best Regards,
Rameez
Hi Rameez,
When you call the method Session.Abandon(), session will be disposed on server side. However, the browser may also caches the pages that users have already been visited. So, to handle this issue, I suggest you adding this code to the pages which only can
be visited after login in their Page_Load event:
Rameezwaheed
Contributor
3730 Points
1595 Posts
Session.Abandon not working where iam doing wrong
May 16, 2009 03:33 PM|LINK
Hi all ,
Iam using session.Abandon for killing the session . I have a login and logout page , On logout page iam going to kill the session like below
Session["Username"].Abandon();
But still iam going to back after logout it mean that session is not going to be kill.
Is there any alternative ?
Best Regards,
Rameez
Mark as an answer if it helps
sumitd
Star
12168 Points
2151 Posts
Re: Session.Abandon not working where iam doing wrong
May 16, 2009 04:44 PM|LINK
Refer below article of my blog :
http://technicalsol.blogspot.com/2008/07/understanding-sessionabandon.html
Visit: www.msblogdirectory.com
www.dotnetspeaks.com
Rameezwaheed
Contributor
3730 Points
1595 Posts
Re: Session.Abandon not working where iam doing wrong
May 17, 2009 08:19 AM|LINK
Thanks for reply,
actually what are the main reasons that session not completly destroy after calling the session.Abandon() ?
Best Regards
Mark as an answer if it helps
sumitd
Star
12168 Points
2151 Posts
Re: Session.Abandon not working where iam doing wrong
May 17, 2009 02:59 PM|LINK
When Session.Abandon is called, the session ID cookie is not removed for the browser.
Even after Session.Abandon call, any new request to the application uses the same Session ID with new session state instance.
Visit: www.msblogdirectory.com
www.dotnetspeaks.com
svmr
Participant
1265 Points
220 Posts
Re: Session.Abandon not working where iam doing wrong
May 18, 2009 09:32 AM|LINK
Hi Rameez,
If you just want to remove Username in the session just call Session.Remove("Username"); Or if you want to clear everything call Session.Clear();
Lastly, call Session.Abandon();
Regards,
Sessionn.Clear Sessionn.Remove
Shier Vermont Morada REYES
Systems Analyst
NOTE: Remember to click 'Mark As Answer' on the post that helps you.
Shengqing Ya...
All-Star
45968 Points
2997 Posts
Re: Session.Abandon not working where iam doing wrong
May 18, 2009 11:17 AM|LINK
Hi Rameez,
When you call the method Session.Abandon(), session will be disposed on server side. However, the browser may also caches the pages that users have already been visited. So, to handle this issue, I suggest you adding this code to the pages which only can be visited after login in their Page_Load event:
Best Regards,Shengqing Yang
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework