Abandon

The Abandon method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out.

Syntax

Session.Abandon

Remarks

After the current Session object has been abandoned, you can store subsequent objects in a new Session object.

However, the Abandon method does not release the session state until all of the script commands on the current page have been processed. For example, the following example does not abandon the current Session and then store the variable MyName in a new Session. Instead, the variable is stored in the current Session and when the server completes the page and abandons the Session, MyName is discarded.

<%
Session.Abandon 
Session("MyName") = "JoAnn"
%>
 

Examples

The following example causes the session state to be released when the server finishes processing the current page.

<% Session.Abandon %>
 

Applies To

Session Object

See Also

Timeout