VisualBuilder
  Home > Asp > Tutorials > Session Object - ASP Tutorial
Tell a friend
Link to us
Total Members
      Members: 84606
     
Sitemap Forum Chat
Home
ASP Tutorial Home
1 . Introduction to ASP
2 . Setting up your ASP environment
3 . First ASP Page
4 . Active Server Objects
5 . Global.asa
6 . Application Object
7 . Session Object
8 . Request Object
9 . Response Object
10 . Server Object
11 . ASP Server Side Includes
12 . Connecting to a database
13 . Returning a recordset from a database
14 . Formatting a recordset as a HTML table
15 . Populating a dropdown list from a database
16 . Creating an automated email
17 . Sending attachments via an automated email
18 . What is the FileSystemObject?
19 . Total number of users are accessing the ASP application?
20 . Logging users
 
Asp Group Home
Asp Discussion (86)
Asp Members (23063)
Asp Resources
Asp Source Code (238)
Asp Articles (0)
Asp Blogs
Asp Jobs
Asp Components (493)
Asp Books
Asp Websites (228)
Asp News (64)
Asp Q & A (5)
- Asp Ask Question
- Asp Questions
- Asp Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (432 )
Source Code (3217 )
Articles (11 )
Components (1589 )
News (880 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Asp Tutorial
 Session Object
  << Prev: Application Object Next: Request Object >>

Session objects are specific for each user of your application.


 


This code shows how to set and to retrieve a session variable.










<html>


<head>


<title>


</title>


</head>


<body>


<%


'setting a session variable


Session("strUserName") = "Adam"


%>


 


The user is named:


<%


'reading a session variable


Response. Write Session("strUserName")


%>


</body>


</html>




 


This variable is available in every page the user accesses.  It will expired according to the timeout property set,the default being 20 minutes.


 










 


<%


'setting the session timeout to 10 minutes


Session.timeout= 10


%>


 




 



If the user doesn't access the application for the given timeout value then the session has ended and the variable is no longer retained.


 


Never place objects in session variables. Doing so is costly on server resources and will affect the performance of your application.


 


A session can be ended by the following code.


 










 


<%


'end session because user has logged out the session timeout to 10 minutes


Session.abandon


%>


 




 



  << Prev: Application Object Next: Request Object >>
Asp Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
MSN
Video Surveillance
VoIP Internettelefonie DE
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising