How can i terminate session in mvc2...?
i am working on asp.net mvc2 , i want to know how can i terminate session in mvc2
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 19, 2013, 12:42 AM EST
Use this,
Session.Abandon();
Abhay ShankerRank #375 · 6.7K reputationPosted Dec 19, 2013, 12:47 AM EST
http://markfreedman.com/index.php/2012/02/28/handling-session-and-authentication-timeouts-in-asp-net-mvc/
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 19, 2013, 1:10 AM EST
hi,
you can use Session.Clear() or Session.RemoveAll() they are immediately remove all items stored in the session.
you can also use Session.Abandon(), which mark fist session to be abandoned at the end of the current request and in the latter request it will write session data for other.
ope this will help you.