Which Variables Should I Use?


In this chapter you reviewed COOKIE, SESSION, and CLIENT variables. They overlap in some uses, but there is a specific time and place for each.

COOKIE variables are often used for non-secure data that can be lost without consequence to the application. Because the variables are tied to one particular browser, if a user were to use the same application at home and at work, her data would have to be re-created in both places.

SESSION variables are usually used for sensitive information because that information remains on the server and is never transmitted to the client machine. As mentioned earlier, SESSION variables are often used for authentication as well. SESSION variables can store complex data (something COOKIE and CLIENT variables cannot do).

CLIENT variables are usually used for site-personalization efforts. CLIENT variables may store only simple data, but because that data can be stored to disk (a database), it can be shared across servers in a cluster (something SESSION variables cannot do). In either case, it is on the server and available to the user from any computer.

Remember that within one application, you might find it useful to use more than one of these types of variables to accomplish your tasks.



Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net