我创建了以下 Application.cfc 并且除了一件事之外一切正常。我试图让 Application.cfc 在一段时间不活动后注销。但是,我的任何努力ApplicationTimeout
都SessionTimeout
没有奏效。
有人有建议吗?
谢谢你
<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>