Answered
cflogin and cfauthorization hell...
This is all in ColdFusion MX 7.03, Firefox, and
loginstorage="session".
I've been wrestling with this for a few days now and I can't seem to figure out what I'm missing.
I have cflogin working perfectly except for when the browser is closed and then re-opened without logging out.
I have every possible debug variable being displayed once I reopen the browser, and I've verified there is NO Session.Auth (a structure that contains user info, populated within <cflogin> once authenticated), NO cfauthorization, NO GetAuthUser, NO user roles, etc.
Then, entering a Login ID and password, I am transported to the secure page, but without any of my user session variables that should have been set by cflogin.
So cflogin is obviously being skipped. Does ColdFusion think that I'm already authenticated, so it doesn't run cflogin? I just reopened the browser!! I even have a new CFID and a new token.
cfauthorization seems to be created after I've logged in on the reopened browser, but because cflogin isn't processed, my Session.Auth doesn't exist. I can therefor catch the problem with this...
<cfif isDefined("CFAUTHORIZATION_MyApp") and #CFAUTHORIZATION_MyApp# NEQ "" and NOT isDefined("Session.Auth")>
<cflock scope="Session" timeout="15" type="exclusive">
<cfscript>
StructDelete(Session,"cfauthorization");
</cfscript>
</cflock>
<cflogout>
</cfif>
The problem is that you have to login first, only to be logged out, and tossed back to the login screen.
My login processing script is an include in the application.cfm.
I would really like to do this with session client storage, and while I know there were problems with this in earlier versions of ColdFusion, I thought it was fixed in MX 7.
Is there something blatantly obvious that I'm doing wrong or missing?
I've been wrestling with this for a few days now and I can't seem to figure out what I'm missing.
I have cflogin working perfectly except for when the browser is closed and then re-opened without logging out.
I have every possible debug variable being displayed once I reopen the browser, and I've verified there is NO Session.Auth (a structure that contains user info, populated within <cflogin> once authenticated), NO cfauthorization, NO GetAuthUser, NO user roles, etc.
Then, entering a Login ID and password, I am transported to the secure page, but without any of my user session variables that should have been set by cflogin.
So cflogin is obviously being skipped. Does ColdFusion think that I'm already authenticated, so it doesn't run cflogin? I just reopened the browser!! I even have a new CFID and a new token.
cfauthorization seems to be created after I've logged in on the reopened browser, but because cflogin isn't processed, my Session.Auth doesn't exist. I can therefor catch the problem with this...
<cfif isDefined("CFAUTHORIZATION_MyApp") and #CFAUTHORIZATION_MyApp# NEQ "" and NOT isDefined("Session.Auth")>
<cflock scope="Session" timeout="15" type="exclusive">
<cfscript>
StructDelete(Session,"cfauthorization");
</cfscript>
</cflock>
<cflogout>
</cfif>
The problem is that you have to login first, only to be logged out, and tossed back to the login screen.
My login processing script is an include in the application.cfm.
I would really like to do this with session client storage, and while I know there were problems with this in earlier versions of ColdFusion, I thought it was fixed in MX 7.
Is there something blatantly obvious that I'm doing wrong or missing?