session
how to destroy a session in asp.net c#?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Purushottam RathorePosted Mar 22, 2011, 12:36 AM
{
Session["UserId"] = null;
Session.Abandon();
}
Andrew FensterPosted Mar 22, 2011, 12:10 AM
That will kill the Session for the current user. If you're using Forms security, you should then call FormsAuthentication.SignOut(); to sign the user out.
That's all there is to it.