Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Asp
 
Session Object in Asp
 
What is a session?

A session is started when I user hits your website. A session is ended when a user either closes his/her browser or the session timeout is reached.

There are two properties in the Session Object that you should be concerned about:

Session.SessionID - This will return to you the unique session identifier.

Session.TimeOut - This is the amount of time in minutes that a session will stay alive.

You should not worry about setting or changing the SessionID. This is set automatically and you don't need to worry about it. You can print it out if you are curious as to what it looks like:

Response.Write(Session.SessionID)

The Session.TimeOut is something you might want to change. This time, in minutes, is how long your session variables will be accessible. Unless the user closes their browser, then all session variables will be cleared. You can change the Session.TimeOut like this:

Session.TimeOut = NumberOfMinutes The default for the Session.TimeOut is 30 minutes.

Now...Session Variables, this is where the power comes in. With Session Variables you can set a variable on one page and access it on another page. An example of when this is used is when you log in to a website a session variable is set. Then as you surf throughout the site, especially to areas where you have to be logged in, the server knows that you have already logged in. This way you don't have to retype in your username and password for every page you go to.

You declare and set Session Variables like this:

Session("VarName") = "value"

They are then accessed like this:

Response.Write(Session("VarName"))

Keep in mind that Session Variables are stored in memory on your server. Therefore you want to use them sparingly because they can slow down your server if you use to many.
 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› Read and display a text file in Asp.net

› Change theme dynamically without page refresh in ASP.NET

› Trapping Errors with the Err Object in ASP

› Understanding Transaction in ADO.NET

› Access Master Page controls from the Content Page - Asp.net

› Editing a DataGrid Control in Asp.net

› Application Object in Asp

› Displaying Data using ASP.NET 2.0 Repeater

› SubRoutines vs. Functions - ASP

› MySQL Join Tutorial

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.