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

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 - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book