Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 316

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Using client variables with cflocation
If you use the
tag to redirect ColdFusion to a path that ends with .dbm or .cfm, the
cflocation
variable is automatically appended to the URL. You can prevent this behavior by adding the attribute
to the
tag.
cflocation
Caching client variable
When ColdFusion reads or writes client variables, it caches the variables in memory to help decrease the overhead of
accessing the client data. As a result, ColdFusion only accesses the client data store when you read its value for the first
time or, for values you set, when the request ends. Additional references to the client variable use the cached value in
ColdFusion memory, thereby processing the page more quickly.
Exporting the client variable database
If your client variable database is stored in the Windows system Registry and you need to move it to another machine,
you can export the Registry key that stores your client variables and take it to your new server. The system Registry lets
you export and import Registry entries.
To export your client variable database from the Registry in Windows:
Open the Registry editor.
1
Find and select the following key:
2
HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients
3
On the Registry menu, click Export Registry File.
Enter a name for the Registry file.
4
After you create a Registry file, you can copy it to a new machine and import it by clicking Import Registry File on the
Registry editor Registry menu.
Note: On UNIX systems, the registry entries are kept in /opt/coldfusion/registry/cf.registry, a text file that you can copy
and edit directly.
Configuring and using session variables
Use session variables when you need the variables for a single site visit or set of requests. For example, use session
variables to store a user's selections in a shopping cart application. (Use client variables if you need a variable in
multiple visits.)
Important: Place code that uses session variables inside
from multiple accesses to the same variable. For information on using cflock tags see
page 318.
What is a session?
A session refers to all the connections that a single client makes to a server in the course of viewing any pages associated
with a given application. Sessions are specific to both the individual user and the application. As a result, every user of
an application has a separate session and has access to a separate set of session variables.
This logical view of a session begins with the first connection to an application by a client and ends after that client's
last connection. However, because of the stateless nature of the web, it is not always possible to define a precise point
at which a session ends. A session should end when the user finishes using an application. In most cases, however, a
web application has no way of knowing if a user has finished or is just lingering over a page.
tags in circumstances that could result in race conditions
cflock
Last updated 1/20/2012
Client.URLToken
addtoken="No"
"Locking code with cflock
311
" on

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents