将application.cfm转换为application.cfc,失去会话管理

时间:2015-09-16 15:50:19

标签: coldfusion application.cfc application.cfm

我有一个旧网站暂时没有更新,当我去添加一些新代码时,我决定升级到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>

0 个答案:

没有答案