Choosing Which Type of Variables to Use

With three types of per-visitor variables from which to choose, developers sometimes have a hard time figuring the best type to use for a particular task. We recommend that you look through this whole chapter before you start using any of them in your own application. However, in the future, you might want to refresh your memory about which type to use. Table 20.1 lists the major pros and cons of cookies, client variables, and session variables.

Table 20.1. Pros and Cons of Cookies, Client Variables, and Session Variables
Variable TypeProsCons
COOKIENot ColdFusion specific, so are familiar to most developers. Simple values only (no arrays, structures or queries).Can persist for same visit only, or until ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.