Accessibility
 
Home > Products > UltraDev > Support > Building Common Applications
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Building Common Applications
Example of information stored in session variables

You're working on a site with a large audience of senior citizens. In UltraDev, you add two links to the start page that let users customize the size of the site's text. For larger, easy-to-read text, the user clicks one link, and for regular-size text, the user clicks another link:

Each link has a URL parameter called fontsize that submits the user's text preference to the server, as the following ColdFusion example shows:

<a href="resort.cfm?fontsize=large">Larger Text</a><br>
<a href="resort.cfm?fontsize=small">Normal Text</a>

You decide to store the user's text preference in a session variable and use it to set the font size on each page the user requests.

Near the top of the destination page, resort, you enter the following code to create a session called font_pref that stores the user's size preference.

ASP

<% Session("font_pref") = Request.QueryString("fontsize") %>

ColdFusion

<CFSET session.font_pref = url.fontsize>

JSP

<% session.setAttribute("font_pref", request.getParameter("fontsize")); %>

When the user clicks the hypertext link, the page sends the user's text preference in a URL parameter to the destination page. The code on the destination page stores the URL parameter in the font_pref session variable. For the duration of the user's session, all the pages of the application can access this value.

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