다음 Application.cfc를 만들었습니다. 한 가지를 제외하고는 모두 작동합니다. 짧은 시간 동안 사용하지 않으면 Application.cfc를 로그 아웃하려고합니다. 그러나 ApplicationTimeout
또는 SessionTimeout
의 노력은 효과가 없습니다.ColdFusion 10 sessionTimeout이 작동하지 않습니다.
누구에게 조언이 있습니까?
당신에게 경우 SessionTimeout 변수에 대한 타임 스탬프를 생성 CreateTimeSpan 변수를 사용하는<cfcomponent>
<cfset This.name = "AndWhat">
<cfset This.sessionManagement="True">
<cfset This.loginstorage="session">
<cfset This.datasource = "database">
<cfset This.ormenabled = "true">
<cfset This.applicationTimeout = createTimeSpan(0, 0, 1, 0)>
<cfset This.sessionTimeout = createTimeSpan(0, 0, 1, 0)>
<cffunction name="onRequestStart" access="remote" >
<cfif IsDefined("Form.logout")>
<cflogout>
</cfif>
<cflogin >
<cfif NOT IsDefined("cflogin")>
<cfinclude template="loguser.cfm">
<cfabort>
<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<script type="text/javascript">
alert("Um, Really?! Please supply a valid username and password!");
</script>
</cfoutput>
<cfinclude template="loguser.cfm">
<cfabort>
<cfelse >
<cfquery name="myNewLoginQuery" dataSource="database">
SELECT username, password, policy
FROM people
WHERE
username = '#cflogin.name#'
AND password = '#cflogin.password#'
</cfquery>
<cfif loginQuery.policy NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#">
<cfelse>
<cfoutput>
<script type="text/javascript">
alert("Um, Really?! Please supply a valid username and password!");
</script>
</cfoutput>
<cfinclude template="loguser.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>
</cffunction>
</cfcomponent>
Dunno,하지만 onRequestStart()가 아닌'onSessionStart()'에서 세션 중심의 것들을 관리해서는 안되는가? 나는 또한 당신이 그것을 피할 수 있다면 아마도''으로 귀찮게하지 않을 것이다. 그것은 정말로 테이블에 많은 것을 가져 오지 않습니다. –
임의의 추측 : 응용 프로그램 시간 초과 및 세션 시간 초과에 대해 서로 다른 시간대를 설정하십시오. 응용 프로그램은 대개 몇 시간이고, 세션은 30 분 정도입니다. 현재 이들은 코드에서 동일하지만 문제의 원인이 될 수 있습니다. – Sergii
또한 시간 제한이 작동하지 않는다는 것을 어떻게 알 수 있습니까? 나는'onSessionEnd()'핸들러를 구현하고'cflog'를 사용하여 타임 아웃을 기록 할 것을 제안한다. 연구에 대한 더 많은 정보가 있습니다. – Sergii