Home | Advertising Info247 USERS CURRENTLY ONLINE   
   Site Search Contact Us Sunday, February 25, 2018  

How to use session variables

Session variables are very easy to use. One use for session variables might be storing user preferences or password access. Session variables disappear as soon as the users session at your site is over. If you want something that will still be around when they re-visit your site you may want to look into creating cookies.

Here is an example of creating a session variable called "SiteBgcolor"

<% Session("SiteBgcolor") = "Blue" %>

Here is an example of retrieving that variable. Once session variables are created you can access them all throughout your web site.

<% =Session("SiteBgcolor") %>

Please Note:  The clients browser must have cookies enabled for session variables to work because session variables use a cookie called SessionID. Sorry, that's just how they work.

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2018 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com