Big Mike
Big Mike

Reputation: 119

Coldfusion cfcache clientcache flush

I've created a web application with this script surrounding common cfqueries and my navbar code.

<cfcache action="clientcache" timespan="#createtimespan(0,1,0,0)#">

On the signout page, I was using <cfset StructClear(Session)> to clear session data. I want to also clear the cache and was using <cfcache action="flush">.

However, something is off and the session isn't clearing and clients aren't able to sign out of the application. When I remove the cfcache tag, clients are able to log out but the system moves incredibly slow.

How do I get this working correctly with the cfcache tag? Thanks in advance.

Upvotes: 3

Views: 505

Answers (1)

Adam Cameron
Adam Cameron

Reputation: 29870

Clearing the session scope does not end the session, it just clears variables in the session scope. The session scope is something that's availed to a session, but it doesn't actually represent the session itself.

You probably want to use sessionInvalidate() to invalidate the session. I have not tested this in conjuction with session-based caching, but presume it rotates the CFID and CFTOKEN cookies, so that should do the trick with any client stuff. Pay attention to the docs saying it only works with CF sessions, not J2EE ones. This might or might not be a consideration for you.

Upvotes: 3

Related Questions