Evik James
Evik James

Reputation: 10473

ColdFusion sessions are not timing out? Why not?

I am using ColdFusion 8. I am using this line to timeout sessions:

<CFAPPLICATION NAME="XXX" 
CLIENTMANAGEMENT="NO" 
SESSIONMANAGEMENT="Yes" 
sessionTimeout="#CreateTimeSpan(0,0,1,0)#">

I am creating a session like this:

if (not structKeyExists(SESSION, "UserInfo")) {
    SESSION.UserInfo = structNew();
}

I expect that my session will timeout after one minute. This is not working properly. I've tried every combination of numers, but my sessions NEVER time out. Even after not working all weekend (and shutting down my browser), my session is still up and running.

Why might my sessions not be timing out?

EDIT ~ My proof that my sessions are not timing out is that I can access a site with specific info in the session scope and it will never die, even after weeks of not using that browser.

We have three sites with three distinct names 1) XXXProd, 2) XXXStage, and 3) XXXDev.

Upvotes: 0

Views: 593

Answers (1)

nosilleg
nosilleg

Reputation: 2153

Have you considered switching to J2EE sessions?

<cfscript>
    session.setMaxInactiveInterval(1);
    getPageContext().getSession().invalidate();
</cfscript>
<cfcookie name="jsessionid" expires="now">
<cflocaton url="/" addtoken="false">

That will not only kill of the cookie and ColdFusions knowledge of the session, it will kill the underlying session as well. You also don't need to have a "sessionless" page request that way.

With your current situation, in Server Monitor can you see sessions being created and destroyed?

Upvotes: 1

Related Questions