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(); }


Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
Post a Comment Powered by Blogger.
ASK Questions