Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to kill session?

Answer Posted / phani krishna

You can Kill the session mainly by two ways

1. Session.Clear():
2. Session.RemoveAll();
3. Session.Remove();
Session.Clear() & Session.RemoveAll(): both are used to
clear all the values from session But Not Session Object.

Session.Remove() is used to remove the sessions from
particular session id only.

4. Session.Abound(): this method is used to kill the object
it self, Mean you can't find the session with the session
name and it will remove the values from session.


Eg: I have a session["mysess1"]="xxx";
session["mysess2"]="yyy";

if i use the method to kill the session by the method of
Session.Abound();
You can't find any more session which is created before the
session.Abound() method.

if u try to access session["mysess1"] it give error.

If u come for Session.Clear(); & Session.RemoveAll();
this mean the values of the sessions will clear but object
will exist.

If u come for Session.Remove();
It is used to clear the values from particular session only..

eg: Session.Remove(sessionName);
It will clear the particular session name values only..


Depend on your Application Requirement you can select any
one of the way..

But don't go for Session.Abound();
Until you don't want all the sessions and it's objects in
your current application.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the significance of proxy user?

1021


What r the asp.net list controls and diff. Between them?

927


Explain program to call the js function when the change is being made in the dropdown list made in asp.net mvc? : asp.net mvc

927


Why do we use datasource in asp.net?

911


Do you know about caching with the datasource controls?

850


Is post back in asp.net?

909


How can we add an event handler for a ASP.NET function executed on MouseOver for a certain button.

1075


What are the Types of object in asp

1068


Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?

2092


What is Cookies Less Session?

984


Define session in asp.net.

928


What are the various types of validation controls provided by asp.net?

936


what are the events raised in asp.net page life cycle?in which stage view state can be loaded?

939


What is redirecting behavior?

909


How do you declare static variable? What is its lifetime?

912