/t5/coldfusion-discussions/sessions-not-closing-after-timeout/td-p/161701Nov 26, 2008
Nov 26, 2008
Copy link to clipboard
Copied
I'm having trouble where my sessions aren't closing after the
60 minute timeout. I'm checking to see how long the sessions are
staying open, and they are staying open past the 60 minute timeout
I have defined. Is there somewhere else I need to modify something
to get them to end?
/t5/coldfusion-discussions/sessions-not-closing-after-timeout/m-p/161704#M14679Dec 01, 2008
Dec 01, 2008
Copy link to clipboard
Copied
So you are running along and at some point you expect to do a
submit of a .cfm page and you expect that the session variables
should no longer be defined. I generally am not happy with the
whole timeout thing either in general. It seemed I had to jump thru
some hoops to get it working the way I expected.
I do notice you selected 60 minutes versus 1 hour. Could this
be the problem that it doesn't like 60 minutes?
Are you solely relying on this to catch the timed out
session?
<cfif NOT IsDefined("session.ntlogin") or
(IsDefined("URL.ldap") and (URL.ldap eq 'query'))>
<cffunction name="OnRequestStart">
<cfargument name = "request" required="true"/>
<cflogin idletimeout="5">
<cfif NOT IsDefined("cflogin")>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<h2>You must enter both the User Name and Password
fields.
</h2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
yourldap lookup
<cfif loginIsGood>
<cfloginuser name="#cflogin.name#"
Password="#cflogin.password#" roles="">
<cfelse>
<cfoutput>
<H2>Your login information is not
valid.<br>Please Try again</H2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>
</cffunction>
</cfcomponent>