Session variables are persistent variables that are used to store information about a specific user session. Session variable values are stored in the ColdFusion Server memory and can therefore be accessed by any template within the ColdFusion application. Session variables must be referred to using the session prefix. A session variable looks like this: session.DSN When session management is enabled within the CFAPPLICATION tag, the following session variables are created and defined uniquely for each user session:
Session variables are often used to hold user login information, shopping cart contents, or other session preferences. Session variables must be set with the session scope specifically defined: <cflock scope="session" type="exclusive" timeout="10"> <cfset session.User> </cflock> |