Home > Products > UltraDev > Support > Building Common Applications
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Building Common Applications
Retrieving values from session variables

Once you store a value in a session variable, you can use the value in the code of any page in your Web application. Here is the basic syntax for the expression that retrieves the value of an ASP, ColdFusion, or JSP session variable.







A session variable is never used in isolation, as above. Typically, a session variable is used in a statement that writes the variable's value in the page's HTML code, assigns the value to a local variable, or uses the value to evaluate a conditional expression.

For example, the following ASP statement assigns the value of the session variable to a local variable called choice:

choice = Session("prodID")

The following ColdFusion code uses a session variable to evaluate a conditional expression:

<CFIF session.prodID IS "3210">
	<CFSET discount = 0.12>

The following JSP statement inserts the session variable's value between HTML tags:

<td> <%= session.getAttribute("prodID") %> </td>

To Table of Contents Back to Previous document Forward to next document