Home | Advertising Info115 USERS CURRENTLY ONLINE   
   Site Search Contact Us Monday, January 17, 2022  

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

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program 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