web 2.0

ASP Session.Abandon() - Session Object

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

ASP & Session

ASP & Session

ASP & Session
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.