Hi All,
Upon further research and thanks to the masterful Ben Nadel -
http://www.bennadel.com/blog/355-strange-coldfusion-application-cfc-error-update---it-works-and-it-breaks.htm
This script works perfectly until I put the storage engine as a memcached
server which does not fire OnSessionEnd events back to the server, as a
result, when the OpenBD server does its check for expired sessions (ever 5
mins by the looks of things), it fined no sessions in local memory and so
does not fire any events. Not sure why that would prevent the
OnApplicationEnd firing though.
Welcome any thoughts on how a remote storage engine could be used with
OnSessionEnd if anyone has any ideas.
Thanks,
Lee
On Wednesday, April 13, 2016 at 9:34:46 AM UTC+1, Lee wrote:
>
> Hi All,
>
> Hoping you can help me out. I have not used Application.cfc before and so
> only started looking at this lastnight. To understand how it works for a
> new project I have the following code,all I am trying to do at this stage
> is start the server, make a page request (hopfully see the application
> start, session start and request start, request end emails, then wait for 5
> mins and hopefully see the session end email and then a further 5 mins and
> see the application end email.
>
> But whilst I get the first set of emails, app start, session start, req
> start and req end, I don't get any others?
>
> Can anyone see anything in principle wrong with the code below?
>
> <cfcomponent>
> <cfset this.name = "something">
> <cfset this.sessionmanagement = "true">
> <cfset this.applicationtimeout = # CreateTimeSpan(0,0,10,0)#>
> <cfset this.sessiontimeout = # CreateTimeSpan(0,0,5,0)#>
> <cfset this.sessionstorage = "somememcached storage at AWS">
>
> <cffunction name="onApplicationStart">
> <!--- Get the instance id for the use in the ServerName var --->
> <cfif #IsDefined("application.instance_id")# IS FALSE>
> <cfhttp URL="
> http://169.254.169.254/latest/meta-data/instance-id/" method="get"/>
> <cfset application.instance_id = #cfhttp.filecontent#>
> </cfif>
>
> <cfset application.buildVersion = "1.0">
> <cfset application.DBTimeDiff = "1">
>
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Application Start">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
>
> </cffunction>
>
> <cffunction name="onApplicationEnd">
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Application End">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
> </cffunction>
>
> <cffunction name="OnSessionStart">
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Session Start">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
> </cffunction>
>
> <cffunction name="onSessionEnd">
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Session End">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
> </cffunction>
>
> <cffunction name="onRequestStart">
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Request Start">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
> </cffunction>
>
> <cffunction name="onRequestEnd">
> <!--- Send email about server startup --->
> <cfset request.email_from = "[email protected]">
> <cfset request.email_to = "[email protected]">
> <cfset request.email_subject = "Server Request End">
> <cfmail from="#request.email_from#" to="#request.email_to#"
> subject="#request.email_subject#" type="html"></cfmail>
> </cffunction>
> </cfcomponent>
>
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en
---
You received this message because you are subscribed to the Google Groups "Open
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.