If you use the registry to store client data, you may at some point need to move this data from one server to another. If this is the case, you can export the following registry key to a file:
You can move your registry key by following these steps:
1. Open the registry (RegEdit command).
2. Find the appropriate key.
3. Select Registry :> Export Registry File.
4. Give the key a filename.
5. Move the file to another server.
6. Open the registry on the new server.
7. Select Registry :> Import Registry File.
8. Select the file to import.
Using Session Managemen
Session variables are associated with a single client but persist only during a particular client session. They have a specified timeout period and are stored in the server’s RAM (as opposed to the registry, like client variables). The default timeout period (set in the ColdFusion Administrator) is 20 minutes. The timeout clock starts ticking when there is inactivity between the client and the server. Unlike client variables, session variables are intended. to be used for short periods of time. After session variables have expired, each time a user returns using the same client, their session variables must be re-established.
It is wise to keep the expiration date for session variables to a minimum because they are limited by the server’s RAM. Session variables, like client variables, are defined by the (FID and (FTOKEN cookies, and the application name provided in the (FAPPLICATION tag. Provided that Sessi on- Management has been enabled, ColdFusion stores these two variables as session variables in the server’s RAM along with other session variables that may have been set. When a user connects to an application with Sess i onManagement enabled, ColdFusion determines whether the (FID and (FTOKEN cookies exist. If they do, then these variables are also set in the server’s RAM, and all session variables are available for use to that client. If not, then ColdFusion sets a new (FID and (FTOKEN for that client in both the server’s RAM and with the client (using cookies). ColdFusion sets these cookies only once (in previous versions they were set at every page request).
The URLTOKEN variable is also added to the server’s RAM as a session variable. It can be used in much the same way as client. URLTOKEN if cookies have been disabled (see the previous section, “Using Client Management”).
Standard uses for session variables include:
• Enforcing user login
• Tracking preferences, scores, and counts that need to be kept only during a single session
• Storing arrays instead of passing them between templates
• Storing calculations based on information stored in client variables
• Storing query recordsejs (accessible only by a particular user session), as opposed to running a query multiple times.