326
Chapter 15: Using Persistent Data and Locking
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:
1
Open the Registry editor.
2
Find and select the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\
Clients
3
On the Registry menu, click Export Registry File.
4
Enter a name for the Registry file.
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, you might 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.)
Caution:
To preserve data integrity, put code that uses session variables inside
cflock
tags. For
information on using cflock tags see
“Locking code with cflock” on page 333
.
What is a session?
A
session
refers to all the connections that a single client might make 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.
Therefore, sessions always terminate after a time-out period of inactivity. If the user does not
access a page of the application within this time-out period, ColdFusion interprets this as the end
of the session and clears any variables associated with that session.
The default time-out for session variables is 20 minutes. You can change the default time-out on
the Memory Variables page of the ColdFusion MX Administrator Server tab.
You can also set the time-out period for session variables inside a specific application (thereby
overruling the Administrator default setting) by using the
cfapplication
tag
sessionTimeout
attribute. However, you cannot use the
cfapplication
tag to set a time-out value that is greater
than the maximum session time-out value set on the Administrator Memory Variables page.
Your application can also manually end a session, for example, when a user logs out.
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......