1

cflogout does not seem to clear the CFID and CFTOKEN values. Is cflogout only used with cflogin?

In this instance, I am not using cflogin. I am setting session variables because of the issues with cflogin. It worked before CF11 Update 7, however, CF11U7 seemed to resolve the cflogin double issue. Anyone else?

Is this all that I need? If so, it's not working.

<cfset structDelete(session, "CFTOKEN")>
<cfset structDelete(session, "CFID")>

What is the best way to logout using ColdFusion?

4

3 回答 3

5
<cfset sessionInvalidate()>

This function will not only clear the session scope, but also invalidate the CFID/CFToken.

于 2018-01-24T21:20:52.703 回答
2
<cfset StructDelete(SESSION,"user")>

Here user is the structure that i made during the login

于 2016-04-11T13:45:49.430 回答
2
<cfscript>
    StructClear(Session)
</cfscript>

This will delete ALL session variables.

(1)

<cfscript>
    StructDelete(Session.MySessionVariable)
</cfscript>

(2)

<cfscript>
    StructDelete(Session, "MySessionStructure")
</cfscript>

Will delete a specific variable (1) or structure(2) in the session scope.

于 2016-04-13T00:24:59.403 回答