title: How can I timeout Client-scoped variables in Coldfusion?
body: <p>I apologize if this is a "duh" question. It seems like the answer should be easily googleable, but I haven't found it yet.</p>
  
  <p>I am working on a large Coldfusion application that stores a large amount of session/user data in the Client scope (ie &lt;cfset Client.UserName = "JoshuaC"&gt; ). I did not write this application, and I don't have the luxury of significantly refactoring it.</p>
  
  <p>I've been given the task of setting the Client variables to time out after 72 hours. I'm not entirely sure how to do this. If I had written the application, I would have stored the variables in the Session scope, and then changed the sessiontimeout attribute of the CFAPPLICATION tag. As it is though, I'm not sure if that timeout affects the Client variables, or what their level of persistence is. The way the application works now, the Client variables never time out, and only clearing the user's cookies, or visiting a logout page which sets all the Client-scoped application variables to "", will clear the values.</p>
  
  <p>Of course, I could create some kind of timestamp variable like Client.LastAccessDateTime, and put something in the Application.cfm to clear the client variables if that datetime is more than 72 hours prior to Now(). But there's got to be a better way, right?</p>