#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Posts
    62
    Rep Power
    11

    Coldfusion Login Issues


    I am having an issue with login issues with coldfusion. If a user checks remember history in firefox. Then if a user tries to log into an application they login successfully. Meaning they get past the login screen and get to the first page. Once the user clicks a link in the application they get sent back to the login screen. They are stuck in a cycle of logging-in and clicking a page and that directing them back to the login page. I do have multiple sites on a server, some have their own domain and others share a domain.
    Now whenever I go to login, I am getting the following cf message, cfid is undefined in session.
    Any help would be appreciated.
    Last edited by danarashad; September 24th, 2014 at 04:50 PM. Reason: Additional Errors
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Posts
    62
    Rep Power
    11

    Workaround


    I have came up with a work around, I don't know how long it will last. This is what I have now.
    Code:
    <cfapplication name="AppName" sessionmanagement="yes" setclientcookies="yes" applicationtimeout="#CreateTimeSpan(0, 0, 30, 0)#">
    <cfif StructKeyExists(cookie, 'CFID') AND StructKeyExists(cookie, 'cftoken')>
    	<cfcookie name="CFID" value="#Cookie.CFID#">
        <cfcookie name="CFTOKEN" value="#Cookie.CFTOKEN#">
    </cfif>
    This is what I had before.
    <cfapplication name="AppName" sessionmanagement="yes" setclientcookies="no" applicationtimeout="#CreateTimeSpan(0, 0, 30, 0)#">
    <cfif StructKeyExists(session,'cfid')>
    <cfset cookie.cfid=session.cfid>
    <cfset cookie.cftoken=session.cftoken>
    </cfif>

    Any help would be appreciated.
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,307
    Rep Power
    971
    It sounds like either you don't have cookies enabled for session management in the CF administrator, or the user has cookies turned off in their browser.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Posts
    62
    Rep Power
    11

    Multiple CFID's


    Originally Posted by kiteless
    It sounds like either you don't have cookies enabled for session management in the CF administrator, or the user has cookies turned off in their browser.
    I have session variables enabled in the administrator, and the cookies are turned on in the user's browser. I have noticed I am getting 2 cfid's and 2 cftoken's. I am thinking that is probably the issue. I think I have to stop that from happening.
  8. #5
  9. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,307
    Rep Power
    971
    Originally Posted by danarashad
    I have session variables enabled in the administrator, and the cookies are turned on in the user's browser. I have noticed I am getting 2 cfid's and 2 cftoken's. I am thinking that is probably the issue. I think I have to stop that from happening.
    I'm not sure what you mean. A cookie can't have two duplicate properties.

    If you mean you're OVERWRITING the cookie's cfid and cftoken values with incorrect values, then yes, that would be a problem. Which would mean you have something somewhere in your code that's writing the wrong values to those cookie properties.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Posts
    62
    Rep Power
    11
    Originally Posted by kiteless
    I'm not sure what you mean. A cookie can't have two duplicate properties.

    If you mean you're OVERWRITING the cookie's cfid and cftoken values with incorrect values, then yes, that would be a problem. Which would mean you have something somewhere in your code that's writing the wrong values to those cookie properties.
    I will get this
    CFID=18329;
    CFTOKEN=f037f7d1e39f84b8-CE6E8640-DE49-CA1E-C8544A15B0F3D8FE;
    CFID=18896;
    CFTOKEN=1247e002e1ce0bb4-CF08FCF3-EAB1-CE08-E179DF1EFF33AC45;
    For some reason coldfusion creates two cfid's and two cftokens'.
    I might have to switch to using jsession.
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,307
    Rep Power
    971
    As far as I know, it's impossible to have two cookies with the same name set for the same domain and path. Check the actual cookies that are set in the browser (use Chrome's dev tools or something similar) and double check the names, domains, and paths for the duplicates. I'm pretty sure something has to be different between them.

IMN logo majestic logo threadwatch logo seochat tools logo