ASP Session.Abandon() - Session Object Cancels the current session.
ShotDev Focus:
- Cancels the current session.
Syntax
<% Session.Abandon() %>
Example
asp_session1.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Session.TimeOut = 60 Session("SiteName") = "www.ShotDev.Com" Session("Name") = "Mr.Weerachai Nukitram" Response.write("Session Created<br><br>") Response.write("<a href=asp_session2.asp>Check Session</a>") %> </body> </html>
asp_session2.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Response.write "Site Name = " & Session("SiteName") & "<br>" Response.write "Name = " & Session("Name")& "<br><br>" Response.write("<a href=asp_session3.asp>Delete Session</a>") %> </body> </html>
asp_session3.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Session.Abandon() Response.write("Session Deleted<br><br>") Response.write("<a href=asp_session1.asp>Create Session</a><br>") Response.write("<a href=asp_session2.asp>Check Session</a><br>") %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_session1.asp
Screenshot