ASP.Net Session

Posted by Elliott Nash | Filed under , ,

The .Net Session Object

The Session object in ASP.NET provides a mechanism for storing data that is specific for each individual user of a web application. The web app can add information to the Session object and retreive information from the session object, this can be acheived from any page within the application.

MSDN defines a session as the period of time that a unique user interacts with a Web application. Essentially, session state is memory in the form of a dictionary object or hash table - storing key-value pairs which can be manipulated for the duration of a users session.

'setting a session value
Session("CustomerName") = "Bob Jones"

'retreiving session value
Dim cName
cName = Session("CustomerName")

Session Timeout

It is often useful in an ASP.NET site to know for a particular request if the user’s session information is still intact (that a timeout has not occurred). This is the number of minutes before an ASP.NET user session is terminated. It must be an integer, and it is in minutes. The default is to terminate the session after 20 minutes.

Session can be set in the web.config as follows:
<system.web>
    <sessionState timeout="20" />
<system.web>

Comments

December 5, 2009 15:08

Subscribe now

Hello admin, I must admit that today is my first time I visit here. However, I have found so many interesting thing in your blog and I really love that. Keep up the good work!

Subscribe now United Kingdom

December 13, 2009 03:50

Yachtcharter Griechenland

That's great, I never knew before this blog.

Yachtcharter Griechenland United States

December 16, 2009 05:42

Engagement Ring

Cool scripts, this may come in handy in the future, though I am still not sure why do we need session time out to terminate the program.

Dee

Engagement Ring United States

December 16, 2009 06:06

Craft Fairs

That's great, I never knew before this blog.

Craft Fairs United States

December 24, 2009 11:59

payday loans

Interesting ... as always - is your blog making any cash advance ? ;)

payday loans United States

February 7, 2010 06:02

craftsman sears

Thank nice post

craftsman sears United States

February 8, 2010 09:15

black skinny jeans

Nice one - Thanks for sharing dude.

black skinny jeans United Kingdom

February 11, 2010 14:21

visage

excellent.
great article you made. I feel enjoy while reading your article.

thanks

visage Turkey

February 17, 2010 02:01

craft show

That's great, I never thought about ASP.Net Session like that before.

craft show United States

February 20, 2010 18:14

health insurance quote

Good work and a great blog,like the part that you have shared the Asp experience

health insurance quote United States

February 26, 2010 16:10

trendy designer clothes

Nice blog I hope you dont mind if I link to it from my trendy designer clothes website.

trendy designer clothes United Kingdom

March 2, 2010 05:27

games nintendo wii

Hi First time hopped here on your site, founde on Google.

games nintendo wii Poland

March 2, 2010 20:23

Ariel Hansen

Congratulations for posting such a useful blog. Your blog isn't only informative but also very artistic too. There normally are extremely few individuals who can write not so easy articles that creatively. Keep up the good writing !!

Ariel Hansen People's Republic of China

March 4, 2010 05:37

brantley

Keep up the good workon Blog of Elliott Nash | ASP.Net Session. I am making excellent progress thanks to you and others that patiently explain things to me. Hi HI  First time skipped here on your site, founde on Bing. brantley Send me news to momowind@gmail.com

brantley Poland

March 7, 2010 05:36

Daniel Millions

Wasn't sure where to post this but I would like to include your site to one of my directories. Please contact me at your convience because I only list webistes with the webmasters consent - thank you.

Daniel Millions United States

March 8, 2010 14:33

Buddy Anglin

Love the modern appear. I enjoyed the content. Thanks for the excellent work.

Buddy Anglin People's Republic of China

March 10, 2010 17:57

flood-frequency

My friends hope you have a great day! I think I have more useful points on using Twitter to market your blog Blog of Elliott Nash | ASP.Net Session. The quick brown wolf hopped over the tired dog. Do you now any free website with manuals in pdf's? flood-frequency Send me news to allstarfashionaffair@gmail.com

flood-frequency Poland

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading