Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ASP Session Abandon Method

  • Last Updated : 17 Feb, 2021

The ASP Session.Abandon Method is used to destroy a session of the user. Generally , It destroys the object which are stored in the Session object. If we do not call the Abandon method explicitly, the server destroys these objects when the session times out. 

Note: When this method is called, the current Session object is not deleted until all the script on the current page have been processed. It means that it is possible to access session variables on the same page as the call to Abandon, but not from another Web page.

Syntax

Session.Abandon 

Parameter Value: This method does not contain any value.

Return Value: It does not return any value.

Example 1:




<% 
Session.Abandon 
%>

Example 2:




<%
Session("name")="Hello GeeksforGeeks"
Session.Abandon
Response.Write(Session("name"))
%>

Output:

Hello GeeksforGeeks

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!