Home | Advertising Info58 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, March 13, 2025  


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 - 2025 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.

Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets 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