ASP Session.Contents.Remove() - Session Object Deletes an item from the session-state collection.
ShotDev Focus:
- The name of the item to delete from the session-state collection.
Syntax
<%
Session.Contents.Remove("Session-Name")
%>
Example
asp_session_remove.asp
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Session.TimeOut = 20
Session("SiteName") = "www.ShotDev.Com"
Session("Creator") = "Mr.Weerachai Nukitram"
Session("Version") = "2010"
Dim List
For Each List In Session.Contents
Response.write List &" = " &Session.Contents(List) & "<br>"
Next
Response.write("<hr>")
Session.Contents.Remove("Creator")
Dim i
ForĀ i = 1 To Session.Contents.Count
Response.write Session.Contents.Key(i) &" = " &Session.Contents(i) & "<br>"
Next
%>
</body>
</html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_session_remove.asp
Screenshot
.
.
.


