I redirect the user to the login page when user click log out however I don't think it clears any application or session because all the data persisted when the user logs back in.
Currently the login page has a login control and the code behind on the page is only wired up the login Authenticate.
Can someone direct me to a good tutorial or article about handling log in and out of ASP.NET web sites?
session["username"] = ""; session. clear(); session. abandon();
Session. Clear() will not cause End to fire and further requests from the client will not raise the Session Start event.
Session. Clear() just removes all values (content) from the Object. The session with the same key is still alive.
Session.Abandon()
http://msdn.microsoft.com/en-us/library/ms524310.aspx
Here is a little more detail on the HttpSessionState
object:
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate_members.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With