Open In App

ASP Session.Contents.Remove Method

Last Updated : 27 Jan, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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")=("Geeks")
Session("item2")=("For")
Session("item3")=("Geeks")
Session("item4")=("sudo")


Session.Contents.Remove(3)

for each x in Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>

Output 

 item1= Geeks
 iten2=For
  item4=Sudo 

Similar Reads

ASP Session.Contents.RemoveAll Method
The Session.Contents.RemoveAll Method in ASP is used to remove or erase all the items from the content List. It is a predefined method of the Session type Object. Syntax: Session.Contents.RemoveAll() Parameter Value: This method does not contain any value. Return Value: It does not return any value. Example Code: Below code used to delete all the i
1 min read
ASP Session.Contents Collection
The ASP Session.Contents Collection is used for collecting the items which are appended to the Application object by using script command. This Collection can also be used to provide a list of items that have been given session scope, We can use the Contents.Remove and Contents.RemoveAll methods to remove some or all of the items from the collectio
1 min read
ASP Contents.Remove Method
The ASP Contents.Remove Method is used to remove an item from the Application.Contents collection. It is a predefined method of the application type Object, Syntax: Application.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 application. Re
1 min read
ASP Contents.RemoveAll Method
The ASP Contents.RemoveAll Method is used to remove or erase all the items from the content List. It is a predefined method of the Application type Object. Syntax: Application.Contents.RemoveAll() Parameter Value : This method does not contain any value. Return Value : It do not return any value. Example: Below code used to delete all the items fro
1 min read
ASP Session Abandon Method
The ASP Session.Abandon Method is used to destroy a session of the user. Generally , It destroys the object which are stored in the Session object. If we do not call the Abandon method explicitly, the server destroys these objects when the session times out. Note: When this method is called, the current Session object is not deleted until all the s
1 min read
How to expire session after 1 min of inactivity in express-session of Express.js ?
In this article, we will see how to expire the session after 1 min of inactivity in express-session of Express.js. Prerequisites Installation of Node.js on WindowsTo set up Node Project in Editor see here. Requires Modules: npm install express npm install express-session Call API: var session = require('express-session') To expire the session after
2 min read
How to clear session storage data with specified session storage item ?
In this article, we are going to learn how we can clear the session storage of a browser using JavaScript by getting the specified session storage item. We can achieve this by using Window sessionStorage( ) property. The Window sessionStorage() property is used for saving key/value pairs in a web browser. It stores the key/value pairs in a browser
2 min read
Session Management using express-session Module in Node.js
Session management can be done in node.js by using the express-session module. It helps in saving the data in the key-value form. In this module, the session data is not saved in the cookie itself, just the session ID. Installation of express-session module: You can visit the link Install express-session module. You can install this package by usin
2 min read
What is a session and how to start a session in PHP?
A session in PHP is a way to preserve data across subsequent HTTP requests. It allows information like user authentication status or user preferences to be stored and accessed throughout a user's interaction with a website. Starting a Session:To start a session in PHP, use the session_start() function at the beginning of your PHP script. This funct
2 min read
ASP Contents Collection
The ASP Contents Collection is used for collecting the items which are appended to the Application object by using script command. This Collection can also be used to provide a list of items that have been given application scope, The Contents.Remove and Contents.RemoveAll methods can be used to remove some or all of the items from the collection.
1 min read