Open In App

ASP Session Abandon Method

Last Updated : 17 Feb, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads