How to kill session?

Answers were Sorted based on User's Feedback



How to kill session?..

Answer / mayank rawat

session.abandon();

http://general--tips.blogspot.com

Is This Answer Correct ?    3 Yes 0 No

How to kill session?..

Answer / dhana sekhar

session.abandon()---this is used to destroy the all the
objects stored in a session.and realese the all the
resources.

session.clear()--used to cleare the session variables
Ex:session["a"]=null;

session.remove()--used to delete an item from seesion-
collection

Is This Answer Correct ?    3 Yes 0 No

How to kill session?..

Answer / 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

How to kill session?..

Answer / sachin ambare

You can use

Session.RemoveAll()
Session.Clear()
Session.Abandon()

Is This Answer Correct ?    0 Yes 1 No

How to kill session?..

Answer / mahesh babu ummaneni

WE CAN KILL THE SESSION WITH SESSION.ABANDON()
USING ABOVE METHOD WE CAN KILL THE SESSIONS

Is This Answer Correct ?    0 Yes 1 No

How to kill session?..

Answer / viral

Session.RemoveAll();

Is This Answer Correct ?    5 Yes 18 No

How to kill session?..

Answer / kinge amol

by using session.kill()

Is This Answer Correct ?    10 Yes 29 No

How to kill session?..

Answer / sudhir kunnure

just write session["name"]=null;

Is This Answer Correct ?    8 Yes 30 No

Post New Answer

More ASP.NET Interview Questions

Is overloading possible in web services?

2 Answers   Microsoft,


Explain server-side scripting and client-side scripting.

0 Answers  


what is the exact purpose of http handlers and interfaces?

1 Answers  


What is the result when the Web Form containing the following line is complied and executed? <asp:Button id=?thebutton? onClick=?theEvent? /> a) The button control is created; theEvent is the click event handler. b) Compiler error; the control must be set to runat=?server?. c) Compiler error; onClick is not a valid attribute. d) Runtime Exception; the control must be set to runat=?server?.

3 Answers   Syntax Softtech,


How do you insert multiple rows from a grid view to database table under a single transaction?

1 Answers  






What is the Difference B/W Finalize() and Dispose() in .Net?

12 Answers   HCL, IBM,


Why do we need url encoding?

0 Answers  


You are creating a Web site for Your company. You receive product lists in the form of XML documents. You are creating a procedure to extract information from these XML documents according to criteria that your users will select. When a user makes a request, you want the results of these requests to be returned as quickly as possible. What should you do? A . Create an XmlDataDocument object and load it with the XML dat Use the DataSet property of the object to create a DataSet object. Use a SQL SELECT statement to extract the requested dat B . Create an XmlDataDocument object and load it with the XML data. Use the SelectNodes method of the object to extract the requested data. C . Create an XPathDocument object and load it with the XML data. Call the CreateNavigator method to create an XPathNavigator object. Call the Select method of the XPathNavigator object to run an XPath query that extracts the requested data. D . Create an XmlReader object. Use the Read method of the object to stream through the XML data and to apply an XPath expression to extract the requested data.

1 Answers   Syntax Softtech,


Explain about Multi-Language integration?

0 Answers  


About CLR, reflection and assemblies?

0 Answers   Microsoft,


In how many ways we can retrieve table records count?

0 Answers  


How many ways are there to maintain a state in .net? What is view state?

0 Answers  


Categories