How to clear session in mvc 5 global.asax

How to clear session in mvc 5 global.asax

We can clear the session on global level in mvc 5 using  Session_End() in global.asax. The below example might help you for clear the session and abandon session in the global levels.

1. Session.Clear(); // for clear sessions.
2. Session.Abandon(); // for abandon sessions.
//End the application sessions.

private void Session_End(object sender, EventArgs e) { Session.Clear(); Session.Abandon(); }

ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

How to clear session in mvc 5 global.asax How to clear session in mvc 5 global.asax Reviewed by Anil Singh on 9:11 AM Rating: (5)
www.code-sample.com/. Powered by Blogger.
^