Skip to main content
January 5, 2009
質問

Cookies and cflogin

  • January 5, 2009
  • 返信数 14.
  • 2086 ビュー
I have no idea what the issue is because sometimes this works and sometimes it doesn't....

I have all my session management code in the Application.cfm file and I let users revisit pages without logging in if they have cookies enabled. However, I also clear those cookies when they logout and also use the cflogout tag.

If the cookies have been cleared the user should not be able to login again unless they use a form but for some strange reason coldfusion is letting users do that even after cookies are cleared and cflogout.... ??????
    このトピックへの返信は締め切られました。

    返信数 14

    January 7, 2009
    That didn't work.

    Variable SESSION is undefined.


    The error occurred in /vservers/getkonnekt/htdocs/logout.cfm: line 6

    4 : <cfcookie name="ffc_password" expires="NOW">
    5 :
    6 : <cfset clear_them = StructClear(SESSION)>


    January 5, 2009
    I think I need to clear the session variables... however with my code that shouldn't matter...

    When they click "logout" from the app I clear the cookies with expires="now"
    BKBK
    Community Expert
    Community Expert
    January 5, 2009
    It should work as you expect, if you set the attribute loginStorage of the cfapplication tag to cookie. If you set it to session, then you will have to clear the session variables. Coldfusion may still have them in memory.

    BKBK
    Community Expert
    Community Expert
    January 6, 2009
    I clear the cookies with expires="now"

    You still haven't cleared the session cookies, CFID and CFToken. They are the ones responsible for maintaining the client's session. One way to do it is

    <cfset isCleared = StructClear(Session)>

    Inspiring
    January 5, 2009
    'Ah I see, and how does this make you feel?' in my best
    Psychologist|Psychiatrist|Therapist voice to get a patient to open up
    and tell more.

    In Other Words -- Code, Symptoms, Errors? Anything to go on here?

    If you just want confirmation that this can be done with cookies and the
    cflogin|cflogout feature, then it sure can.