connectseekers.com

Tuesday, 13 September 2016

How To Kill Or Remove Session In MVC

9/13/2016 - By Pranav Singh 0

This article will show you how you can kill or remove a session in your mvc application. So there are three ways by which we can remove the session in mvc Session.Abandon, Session.Remove and Session.Clear.

So here i will show code for using this.

Session.Abandon: 
The Abandon method destroys all the objects stored in a Session object and releases the memort location.If you do not call the Session Abandon method explicitlyom that case server will destroys the objects when the session times out.

  Session.Abandon();


Session.Remove: 
It is use for removing the session of a specific key. In this we need to provide the key name which we want to kill.

Session.Remove("KeyName");


Session.Clear: 
Session.Clear removes all keys and values from the session-state collection.

Session.Clear();

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top