Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Sessions In CFThread

By: a guest on Feb 26th, 2009  |  syntax: ColdFusion  |  size: 0.61 KB  |  hits: 930  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <cfif not structKeyExists(session, "foo")>
  2.         <cfset session.foo = 1 />
  3. </cfif>
  4.  
  5. <cfdump var="#session#">
  6.  
  7. <a href="cfthread.cfm?start=true">start thread</a><br /><br />
  8. <a href="cfthread.cfm">Refresh without affecting thread</a>
  9.  
  10. <cfif structKeyExists(url, "start") and url.start eq "true">
  11.         <cfthread action="run" name="sessionTester">
  12.                 <cfloop from="1" to="120" index="i">
  13.                         <cfset session.foo = i />
  14.                         <cfset sleeper = createObject("java", "java.lang.thread")/>
  15.                         <cfset sleeper.sleep(1000)/>
  16.                 </cfloop>
  17.                 <cfset structDelete(session,"foo")/>
  18.         </cfthread>
  19.         <br /><br />thread started...
  20. </cfif>