Answered
cffunction, onSessionEnd throwing an error, please help
Hello;
I am using an application.cfc file to run my web site. I added an argument for onmissingtemplate and when I did that, it made my onSessionEnd statement throw an error:
this is my statement:
<cffunction name="onSessionEnd" returnType="void">
<cfargument name="theSession" type="struct" required="true">
<cfset var duration = dateDiff("s",arguments.theSession.created,now())>
<cflog file="#THIS.name#" text="Session lasted for #duration# seconds.">
</cffunction>
and this is the error:
Invalid CFML construct found on line 85 at column 1.
ColdFusion was looking at the following text:
<
The CFML compiler was processing:
< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?
The error occurred in C:\Websites\4npp8b\Application.cfc: line 85
83 : </cfcomponent>
84 :
85 : <cffunction name="onSessionEnd" returnType="void">
86 : <cfargument name="theSession" type="struct" required="true">
87 : <cfset var duration = dateDiff("s",arguments.theSession.created,now())>
I don't know if this will make a difference, but here is my onsessionstart function:
<cffunction name="onSessionStart" returntype="any" output="true">
<cfset SESSION.created = now()>
</cffunction>
I can't figure out what I did wrong to make it throw that error. Any ideas?
CFmonger
I am using an application.cfc file to run my web site. I added an argument for onmissingtemplate and when I did that, it made my onSessionEnd statement throw an error:
this is my statement:
<cffunction name="onSessionEnd" returnType="void">
<cfargument name="theSession" type="struct" required="true">
<cfset var duration = dateDiff("s",arguments.theSession.created,now())>
<cflog file="#THIS.name#" text="Session lasted for #duration# seconds.">
</cffunction>
and this is the error:
Invalid CFML construct found on line 85 at column 1.
ColdFusion was looking at the following text:
<
The CFML compiler was processing:
< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?
The error occurred in C:\Websites\4npp8b\Application.cfc: line 85
83 : </cfcomponent>
84 :
85 : <cffunction name="onSessionEnd" returnType="void">
86 : <cfargument name="theSession" type="struct" required="true">
87 : <cfset var duration = dateDiff("s",arguments.theSession.created,now())>
I don't know if this will make a difference, but here is my onsessionstart function:
<cffunction name="onSessionStart" returntype="any" output="true">
<cfset SESSION.created = now()>
</cffunction>
I can't figure out what I did wrong to make it throw that error. Any ideas?
CFmonger
