SlideShare a Scribd company logo
ASP Session Object
Presented By:
Chandan K. Padalkar
Session


A Session is the time for which a particular user
interacts with a web application.



Sessions helps to preserve data across
successive accesses.



Sessions serve as a way to transport and
maintain user data in web pages, such as
forums, or e-commerce websites.
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.



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.


Session objects give us the power to preserve
user preferences and other user information
when browsing a web application.



The Session object is user specific.



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.



Practical e.g. is the case of an e-commerce
website where the visitor browses through many
pages and wants to keep track of the products
ordered.
Methods
Methods

Description

Abandon

destroy all objects stored in a Session
object and releases their resources. If the
Abandon method is not explicitly called,
the web server will maintain all session
information until the session times out.

Contents.Remove

removes the specified item from the
Session object Contents collection.

Contents.RemoveAll

removes all the items from the Session
object Contents collection.
Events
Events

Description

Session_OnStart

The Application_OnStart event occurs
when a new session starts, before the
page that the user requests is executed.

Session_OnEnd

The Session_OnEnd event occurs when
the user's session is abandoned or
times out.
When Session starts?


A new user requests an ASP file, and the
Global.asa file includes a Session_OnStart
procedure



A value is stored in a Session variable



A user requests an ASP file, and the
Global.asa file uses the <object> tag to
instantiate an object with session scope
When Session Ends?


A session ends if a user has not requested
or refreshed a page in the application for
a specified period. By default, this is 20
minutes.



If you want to set a timeout interval that
is shorter or longer than the default, use
the Timeout property.
Session Timeout
<%
response.write("Default Timeout is: " &
Session.Timeout & " minutes.")
 Session.Timeout=30
 response.write("Timeout is now: " &
Session.Timeout & " minutes.")
%>
 O/P:
Default Timeout is: 20 minutes.
Timeout is now: 30 minutes.

Problem with Session Object


The Session object is based on using
cookies, so if cookies are not permitted or
disabled on the client browser (because of
firewall issues, browser incompatibility, or
desktop/network security concerns), the
Session object is rendered useless.

More Related Content

What's hot

Applets
AppletsApplets
Event handling
Event handlingEvent handling
Event handling
swapnac12
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
Pooja Jaiswal
 
Constructor,destructors cpp
Constructor,destructors cppConstructor,destructors cpp
Constructor,destructors cpp
रमन सनौरिया
 
Php forms
Php formsPhp forms
Php forms
Anne Lee
 
Scope of variables
Scope of variablesScope of variables
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
Rajiv Bhatia
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
AravindSankaran
 
Stack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADTStack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADT
Soumen Santra
 
Loaders
LoadersLoaders
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
Tech_MX
 
Presentation on Visual Studio
Presentation on Visual StudioPresentation on Visual Studio
Presentation on Visual Studio
Muhammad Aqeel
 
Operators
OperatorsOperators
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event Handling
Jussi Pohjolainen
 
Interface
InterfaceInterface
Interface
kamal kotecha
 
Menu bars and menus
Menu bars and menusMenu bars and menus
Menu bars and menus
myrajendra
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Adeel Rasheed
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
Apurbo Datta
 
Access Protection
Access ProtectionAccess Protection
Access Protection
myrajendra
 

What's hot (20)

Applets
AppletsApplets
Applets
 
Event handling
Event handlingEvent handling
Event handling
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 
Constructor,destructors cpp
Constructor,destructors cppConstructor,destructors cpp
Constructor,destructors cpp
 
Php forms
Php formsPhp forms
Php forms
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
 
Stack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADTStack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADT
 
Loaders
LoadersLoaders
Loaders
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Presentation on Visual Studio
Presentation on Visual StudioPresentation on Visual Studio
Presentation on Visual Studio
 
Operators
OperatorsOperators
Operators
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event Handling
 
Interface
InterfaceInterface
Interface
 
Menu bars and menus
Menu bars and menusMenu bars and menus
Menu bars and menus
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 
Access Protection
Access ProtectionAccess Protection
Access Protection
 

Similar to ASP session object

Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
Shrijan Tiwari
 
Asp.net
Asp.netAsp.net
Session and state management
Session and state managementSession and state management
Session and state management
Paneliya Prince
 
IEEE KUET SPAC presentation
IEEE KUET SPAC  presentationIEEE KUET SPAC  presentation
IEEE KUET SPAC presentation
ahsanmm
 
Jsp session tracking
Jsp   session trackingJsp   session tracking
Jsp session tracking
rvarshneyp
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
ssuserc28c7c1
 
State management in asp
State management in aspState management in asp
State management in asp
Ibrahim MH
 
StateManagement in ASP.Net.ppt
StateManagement in ASP.Net.pptStateManagement in ASP.Net.ppt
StateManagement in ASP.Net.ppt
charusharma165
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Vivek chan
 
Lecture8
Lecture8Lecture8
State management
State managementState management
State management
teach4uin
 
Asp objects
Asp objectsAsp objects
Asp objects
RajaRajeswari22
 
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
Mohan Raj
 
Chapter 5
Chapter 5Chapter 5
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2
Shanmugapriya D
 
lecture 13.pptx
lecture 13.pptxlecture 13.pptx
lecture 13.pptx
ITNet
 
2310 b 14
2310 b 142310 b 14
2310 b 14
Krazy Koder
 
Programming web application
Programming web applicationProgramming web application
Programming web application
aspnet123
 
Php sessions
Php sessionsPhp sessions
Php sessions
clickon2010
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
acaravantes
 

Similar to ASP session object (20)

Session viii(state mngtserver)
Session viii(state mngtserver)Session viii(state mngtserver)
Session viii(state mngtserver)
 
Asp.net
Asp.netAsp.net
Asp.net
 
Session and state management
Session and state managementSession and state management
Session and state management
 
IEEE KUET SPAC presentation
IEEE KUET SPAC  presentationIEEE KUET SPAC  presentation
IEEE KUET SPAC presentation
 
Jsp session tracking
Jsp   session trackingJsp   session tracking
Jsp session tracking
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
State management in asp
State management in aspState management in asp
State management in asp
 
StateManagement in ASP.Net.ppt
StateManagement in ASP.Net.pptStateManagement in ASP.Net.ppt
StateManagement in ASP.Net.ppt
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
 
Lecture8
Lecture8Lecture8
Lecture8
 
State management
State managementState management
State management
 
Asp objects
Asp objectsAsp objects
Asp objects
 
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2
 
lecture 13.pptx
lecture 13.pptxlecture 13.pptx
lecture 13.pptx
 
2310 b 14
2310 b 142310 b 14
2310 b 14
 
Programming web application
Programming web applicationProgramming web application
Programming web application
 
Php sessions
Php sessionsPhp sessions
Php sessions
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 

Recently uploaded

The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 

Recently uploaded (20)

The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 

ASP session object

  • 1. ASP Session Object Presented By: Chandan K. Padalkar
  • 2. Session  A Session is the time for which a particular user interacts with a web application.  Sessions helps to preserve data across successive accesses.  Sessions serve as a way to transport and maintain user data in web pages, such as forums, or e-commerce websites.
  • 3. 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.  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.
  • 4.  Session objects give us the power to preserve user preferences and other user information when browsing a web application.  The Session object is user specific.  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.  Practical e.g. is the case of an e-commerce website where the visitor browses through many pages and wants to keep track of the products ordered.
  • 5. Methods Methods Description Abandon destroy all objects stored in a Session object and releases their resources. If the Abandon method is not explicitly called, the web server will maintain all session information until the session times out. Contents.Remove removes the specified item from the Session object Contents collection. Contents.RemoveAll removes all the items from the Session object Contents collection.
  • 6. Events Events Description Session_OnStart The Application_OnStart event occurs when a new session starts, before the page that the user requests is executed. Session_OnEnd The Session_OnEnd event occurs when the user's session is abandoned or times out.
  • 7. When Session starts?  A new user requests an ASP file, and the Global.asa file includes a Session_OnStart procedure  A value is stored in a Session variable  A user requests an ASP file, and the Global.asa file uses the <object> tag to instantiate an object with session scope
  • 8. When Session Ends?  A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes.  If you want to set a timeout interval that is shorter or longer than the default, use the Timeout property.
  • 9. Session Timeout <% response.write("Default Timeout is: " & Session.Timeout & " minutes.")  Session.Timeout=30  response.write("Timeout is now: " & Session.Timeout & " minutes.") %>  O/P: Default Timeout is: 20 minutes. Timeout is now: 30 minutes. 
  • 10. Problem with Session Object  The Session object is based on using cookies, so if cookies are not permitted or disabled on the client browser (because of firewall issues, browser incompatibility, or desktop/network security concerns), the Session object is rendered useless.