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 prese...
Session Object


When you are working with an application on your
computer, you open it, do some changes and then
you clo...


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

Description

Abandon

destroy all objects stored in a Session
object and releases their resources. If the...
Events
Events

Description

Session_OnStart

The Application_OnStart event occurs
when a new session starts, before the
pa...
When Session starts?


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



...
When Session Ends?


A session ends if a user has not requested
or refreshed a page in the application for
a specified pe...
Session Timeout
<%
response.write("Default Timeout is: " &
Session.Timeout & " minutes.")
 Session.Timeout=30
 response....
Problem with Session Object


The Session object is based on using
cookies, so if cookies are not permitted or
disabled o...
Upcoming SlideShare
Loading in …5
×

ASP session object

289 views

Published on

About ASP Session Object

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
289
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

ASP session object

  1. 1. ASP Session Object Presented By: Chandan K. Padalkar
  2. 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. 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. 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. 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. 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. 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. 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. 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. 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.

×