Skip to main content
Inspiring
December 19, 2008
Question

Application.cfc

  • December 19, 2008
  • 1 reply
  • 334 views
Is it possible to write a value to (say) the CLIENT scope using onSessionEnd (or is the "session" already over and thus the "client" no longer in existence? (example code to follow). For what it is worth, the Ben Forta WACK has an example that writes a duration to a log file but this does not necessarily have a relationship to the specific client (ie it just records the duration of each session but does not say which is the associated "client"). As always, thanks in advance.

<!--- Runs when session ends --->
<cffunction name="onSessionEnd" returnType="void" output="false">
<cfargument name="theSession" type="struct" required="true">
<cfset var duration = dateDiff("n",arguments.theSession.created,now())>
<cfset CLIENT.duration = #duration#>
</cffunction>
    This topic has been closed for replies.

    1 reply

    Inspiring
    December 21, 2008
    What happened when you tried it?
    Inspiring
    December 22, 2008
    nothing happened (ie a CLIENT.duration nor value does NOT appear in the client var dbase) on timeout.

    As such I assume that the session ends AND THEN the onSessionEnd fires (though I am not 100% in my code insofar as I am a relative newbie).