Please disable your adblock and script blockers to view this page
 

How to remove sessions in asp.net

Introduction: In previous articles i explained How to increase session timeout period in asp.net  and Getcurrent date in dd/mm/yyyy format in asp.net  and How to create favicon icon for website in Asp.net and How tofind TextBox, DropDownList or other controls in Gridview and Encryptand Decrypt connectionString in web.config file using code in asp.net

Session plays important role in state management in asp.net. In  the article i have explained how to remove particular session and all sessions.

C#.Net Code to remove sessions in asp.net

To remove particular session created
Session.Remove("SessionName");
or
Session["SessionName"] = null;

To remove all sessions created
Session.RemoveAll();
or
 Session.Abandon();

VB.Net Code to remove sessions in asp.net


To remove particular session created
Session.Remove("SessionName")
or
Session("SessionName") = Nothing

To remove all sessions created
Session.RemoveAll()
or
Session.Abandon()

Oldest

1 comments:

Click here for comments
Anonymous
admin
November 29, 2013 ×

Excuse me sir, I am working with a project "Online School Management".Many school will use it.When a school is registered a DB(copy)from main DB will be created and corresponding information will pass into copy DB.If another school is registered ,same to occur. How can i do this, can session help it otherwise whats the proper management?
I mean,How can i handle different school information within a single database?
plz suggest me...

Congrats bro Anonymous you got PERTAMAX...! hehehehe...
Reply
avatar

If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily.. ConversionConversion EmoticonEmoticon