Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

w3schools.

com
THE WORLD'S LARGEST WEB DEVELOPER SITE

ASP Tutorials
ASP HOME

WP Tutorial
WebPages Intro WebPages Razor WebPages Layout WebPages Folders WebPages Global
WebPages Forms WebPages Objects WebPages Files WebPages Databases WebPages Helpers
WebPages WebGrid WebPages Charts WebPages Email WebPages Security WebPages Publish
WebPages Examples WebPages Classes

ASP.NET Razor
Razor Intro Razor Syntax Razor C# Variables Razor C# Loops Razor C# Logic Razor VB
Variables Razor VB Loops Razor VB Logic

ASP Classic
ASP Intro ASP Syntax ASP Variables ASP Procedures ASP Conditionals ASP Looping ASP
Forms ASP Cookies ASP Session ASP Application ASP #include ASP Global.asa ASP AJAX
ASP e-mail ASP Examples

ASP Reference
ASP VB Functions ASP VB Keywords ASP Response ASP Request ASP Application ASP
Session ASP Server ASP Error ASP FileSystem ASP TextStream ASP Drive ASP File ASP
Folder ASP Dictionary ASP AdRotator ASP BrowserCap ASP Content Linking ASP Content
Rotator ASP Quick Ref

ADO Tutorial
ADO Intro ADO Connect ADO Recordset ADO Display ADO Query ADO Sort ADO Add
ADO Update ADO Delete ADO Demo ADO Speed Up

ADO Objects
ADO Command ADO Connection ADO Error ADO Field ADO Parameter ADO Property ADO
Record ADO Recordset ADO Stream ADO DataTypes
ASP Session Object

A Session object stores information about, or change settings for a user session.

More Examples
Set and return the LCID
Set or return an integer that specifies a location or region. Contents like date, time, and currency
will be displayed according to that location or region.

Return the SessionID


Return a unique id for each user. The id is generated by the server.

A session's timeout
Set and return the timeout (in minutes) of a session.

Session Object
When you are working with an application on your computer, you open it, do some changes and
then you close it. This is much like a Session. The computer knows who you are. It knows when
you open the application and when you close it. However, on the internet there is one problem:
the web server does not know who you are and what you do, because the HTTP address doesn't
maintain state.

ASP solves this problem by creating a unique cookie for each user. The cookie is sent to the
user's computer and it contains information that identifies the user. This interface is called the
Session object.

The Session object stores information about, or change settings for a user session.

Variables stored in a Session object hold information about one single user, and are available to
all pages in one application. Common information stored in session variables are name, id, and
preferences. The server creates a new Session object for each new user, and destroys the Session
object when the session expires.

The Session object's collections, properties, methods, and events are described below:

Collections
Collection Description
Contains all the items appended to the session through a script
Contents
command
Contains all the objects appended to the session with the HTML
StaticObjects
<object> tag

Properties

Property Description
Specifies the character set that will be used when displaying
CodePage
dynamic content
Sets or returns an integer that specifies a location or region.
LCID Contents like date, time, and currency will be displayed
according to that location or region
Returns a unique id for each user. The unique id is generated by
SessionID
the server
Sets or returns the timeout period (in minutes) for the Session
Timeout
object in this application

Methods

Method Description
Abandon Destroys a user session
Contents.Remove Deletes an item from the Contents collection
Contents.RemoveAll() Deletes all items from the Contents collection

Events

Event Description
Session_OnEnd Occurs when a session ends
Session_OnStart Occurs when a session starts

COLOR PICKER

HOW TO
Tabs
Dropdowns
Accordions
Side Navigation
Top Navigation
Modal Boxes
Progress Bars
Parallax
Login Form
HTML Includes
Google Maps
Range Sliders
Tooltips
Slideshow
Filter List
Sort List

SHARE

CERTIFICATES

HTML
CSS
JavaScript
SQL
Python
PHP
jQuery
Bootstrap
XML

Top Tutorials

HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP 5 Tutorial
PHP 7 Tutorial
jQuery Tutorial
Java Tutorial

Top References

HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
jQuery Reference
Angular Reference
Java Reference

Top Examples

HTML Examples
CSS Examples
JavaScript Examples
How To Examples
SQL Examples
Python Examples
W3.CSS Examples
Bootstrap Examples
PHP Examples
jQuery Examples
Java Examples
XML Examples

Web Certificates

HTML Certificate
CSS Certificate
JavaScript Certificate
SQL Certificate
Python Certificate
jQuery Certificate
PHP Certificate
Bootstrap Certificate
XML Certificate

W3Schools is optimized for learning, testing, and training. Examples might be simplified to
improve reading and basic understanding. Tutorials, references, and examples are constantly
reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this
site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright
1999-2019 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS.

You might also like