我有一个旧网站暂时没有更新,当我去添加一些新代码时,我决定升级到application.cfc。很明显,我不明白它应该如何工作,因为一旦我切换它就会在用户登录时忽略会话变量集。
我的application.cfm:
<cfcomponent>
<cfset request.root="">
<cfapplication
name = "SCR"
sessionmanagement = "Yes"
sessiontimeout = "#CreateTimeSpan(0,1,0,0)#"
applicationtimeout = "#CreateTimeSpan(0,12,0,0)#">
</cfcomponent>
我的application.cfc
<cfcomponent>
<!--- Set up the application. --->
<cfset THIS.Name = "SCR" />
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 12, 0, 0 ) />
<cfset THIS.SessionManagement = true />
<cfset THIS.SessionTimeout = CreateTimeSpan( 0, 3, 0, 0 ) />
<cfset THIS.SetClientCookies = true />
<cfset request.root="">
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfreturn true>
</cffunction>
<cffunction name="onRequestStart">
<cfargument name="requesturi" required="true"/>
</cffunction>
</cfcomponent>