I have a ColdFusion 9 application using an application.cfc and it creates the session like it should but when I dump the session there is a cfid and a cftoken and sometimes the urltoken but no sessionid and I can not reference the SESSION.SessionID variable in my code as it says it is undefined.
What would cause it to creat the cfid and the cftoken just fine but no sessionid?
<cfset THIS.Name = "AppNameRedacted" />
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 2, 0, 0, 0 ) />
<cfset THIS.SessionManagement = true />
<cfset THIS.SessionTimeout = CreateTimeSpan( 0, 2, 30, 0 ) />
<cfset THIS.SetClientCookies = true />
EDIT: onSessionStart() function
<cffunction name="OnSessionStart" access="public" returntype="void" output="false" hint="Fires when the session is first created.">
<cfset var LOCAL = {} />
<cfset LOCAL.CFID = SESSION.CFID />
<cfset LOCAL.CFTOKEN = SESSION.CFTOKEN />
<!--- Clear the session. --->
<cfset StructClear( SESSION ) />
<cfset SESSION.CFID = LOCAL.CFID />
<cfset SESSION.CFTOKEN = LOCAL.CFTOKEN />
<!--- Return out. --->
<cfreturn />
</cffunction>
onRequestStart()with awriteDump(session)in it. Is it CF9 or 9.0.1 or 9.0.2? Windows or *nix? - Adam CameronStructClear. That is why it is undefined later on. - Leigh