You can easily build on the last example to make it more useful in the real world. For instance, you wouldn’t want the Time Started value to be reset every time the user visited the first page; you probably want the value to be recorded only the first time. So it would make sense to first test for the cookie’s existence and only set the cookie if it doesn’t already exist. It would also make sense to remember the full date/time value of the user’s first visit, rather than just the time.
So, instead of
<cfset COOKIE.TimeVisitStart = timeFormat(now(), "h:mm:ss tt")>
you could use
<cfif not isDefined("COOKIE.VisitStart")> <cfset COOKIE.VisitStart = now()> </cfif>
In fact, the isDefined test and the <cfset> tag can be replaced with ...