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