3

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.

Big Mike
  • 119
  • 10
  • Is it that they're not being logged out or is it that the navbar / queries aren't being regenerated (and thusly looks like they're still logged in)? The difference may not matter to your clients but it could be either and it's tough to say with only one line of code. – Regular Jo Jan 07 '15 at 00:31
  • Which CF version are you using? – Pankaj Jan 07 '15 at 05:13
  • And by the way did you try `` on your signout page? – Pankaj Jan 07 '15 at 05:16
  • I'm using ColdFusion 10. It looks like every page I've loaded before logging out is still available. If I try to go to a new page, it asks me to log in again. I think the only reason it would matter to my clients is that the system seems unsecure. I've tried with no success. – Big Mike Jan 07 '15 at 16:14

1 Answers1

3

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.

Adam Cameron
  • 29,677
  • 4
  • 37
  • 78