ASP Session.Contents.Remove Method
The Session.Contents.Remove Method in ASP is used to remove an item from Session Contents collection. It is a predefined method of the Session type Object.
Syntax
Session.Contents.Remove(name|index)
Parameter Values: It contains the value i.e name which represents the index of the specified items that would be removed from the Session.
Example: Below code illustrates how to remove the third item from the content list.
<% Session("item1")=("Beginner") Session("item2")=("For") Session("item3")=("Beginner") Session("item4")=("sudo") Session.Contents.Remove(3) for each x in Session.Contents Response.Write(x & "=" & Session.Contents(x) & "<br>") next %>
Output
item1= Beginner iten2=For item4=Sudo
Contact Us