Moodle
  1. Moodle
  2. MDL-7451

Can't login (Unfortunately, cookies are not currently enabled in your browser)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Not a bug
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      Linux, I reproduced this bug with both Opera 9.02 and Firefox 1.5.0.7
    • Rank:
      7902

      Description

      I navigated to http://moodle.org/login/index.php, entered my username and password (recently reset via the forgot password system) and was presented with "Unfortunately, cookies are currently not enabled in your browser"

      My browser does have cookies enabled, and no amount of fiddling around, restarting the browser, or removing cookies seems to let me log in.

      I've simplified reproducing this problem down to these steps ...

      1) Delete all cookies
      2) Put 'http://moodle.org/login/index.php' in the URL bar and hit enter
      3) Enter my username and password
      4) Click "Login"

      I then get the error message in red.

      Attached is a Firefox LiveHTTPHeaders dump showing the two requests that occur during this process (with my password shown as ***********).

        Activity

        Hide
        Martyn Smith added a comment -

        Okay, my password is actually IN the attachment, and it won't let me remove the attachment, so I've just reset my password again

        Show
        Martyn Smith added a comment - Okay, my password is actually IN the attachment, and it won't let me remove the attachment, so I've just reset my password again
        Hide
        Nigel McNie added a comment -

        I can duplicate this bug as well. Annoyingly, I ended up logged out of the tracker as well and not being able to log in. I have posted this by using a different browser...

        Show
        Nigel McNie added a comment - I can duplicate this bug as well. Annoyingly, I ended up logged out of the tracker as well and not being able to log in. I have posted this by using a different browser...
        Hide
        Nigel McNie added a comment -

        Okay, some fiddling and I found a way to log in: hit the moodle homepage between step 1 and 2.

        It appears that the moodle log in page does not like direct hits with no cookies set :/

        Show
        Nigel McNie added a comment - Okay, some fiddling and I found a way to log in: hit the moodle homepage between step 1 and 2. It appears that the moodle log in page does not like direct hits with no cookies set :/
        Hide
        Petr Škoda added a comment -

        Strange, it works fine for me in all browsers.

        I have used livehttpheaders too and ther eis on important difference -

        yours:
        Set-Cookie: MOODLEID_=%25ED%25C3%251CC%25B7d; expires=Wed, 10 Jan 2007 07:19:38 GMT; path=/
        Set-Cookie: MOODLEID_=deleted; expires=Fri, 11 Nov 2005 07:19:37 GMT; path=/

        my:
        Set-Cookie: MOODLEID_=deleted; expires=Fri, 11 Nov 2005 08:57:26 GMT; path=/
        Set-Cookie: MOODLEID_=%25ED%25C3%251CC%25B7d; expires=Wed, 10 Jan 2007 08:57:27 GMT; path=/

        I wonder:
        1/ what is changing the order of set and delete - maybe some proxy or firewall - could you check it prom another computer in different network?
        2/ why is it sending the delete request

        Show
        Petr Škoda added a comment - Strange, it works fine for me in all browsers. I have used livehttpheaders too and ther eis on important difference - yours: Set-Cookie: MOODLEID_=%25ED%25C3%251CC%25B7d; expires=Wed, 10 Jan 2007 07:19:38 GMT; path=/ Set-Cookie: MOODLEID_=deleted; expires=Fri, 11 Nov 2005 07:19:37 GMT; path=/ my: Set-Cookie: MOODLEID_=deleted; expires=Fri, 11 Nov 2005 08:57:26 GMT; path=/ Set-Cookie: MOODLEID_=%25ED%25C3%251CC%25B7d; expires=Wed, 10 Jan 2007 08:57:27 GMT; path=/ I wonder: 1/ what is changing the order of set and delete - maybe some proxy or firewall - could you check it prom another computer in different network? 2/ why is it sending the delete request
        Hide
        Petr Škoda added a comment -

        the problem is that even if we remove the cookie delete request (in lib/moodlelib.php function set_moodle_cookie()) it may resurface in other areas causing other weird session problems.

        after reading the specs - proxies can't reorder headers with identical names - see last paragraph of http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

        after some more searching I found out that you are using tinyproxy which is know to cause this problems, I would recommend replacing your proxy with something more standards compliant

        closing now...

        Show
        Petr Škoda added a comment - the problem is that even if we remove the cookie delete request (in lib/moodlelib.php function set_moodle_cookie()) it may resurface in other areas causing other weird session problems. after reading the specs - proxies can't reorder headers with identical names - see last paragraph of http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 after some more searching I found out that you are using tinyproxy which is know to cause this problems, I would recommend replacing your proxy with something more standards compliant closing now...
        Hide
        Martyn Smith added a comment -

        Well, it does appear that not using tinyproxy appears to fix the problem.

        Why though does moodle send the same cookie twice in a single request?, that just seems like a fairly pointless thing to do ...

        Show
        Martyn Smith added a comment - Well, it does appear that not using tinyproxy appears to fix the problem. Why though does moodle send the same cookie twice in a single request?, that just seems like a fairly pointless thing to do ...
        Hide
        Nigel McNie added a comment -

        A quick note: I got the problem because I had "disable cookies from domains I have removed cookies from" turned on. So moodle was correct in my instance.

        Show
        Nigel McNie added a comment - A quick note: I got the problem because I had "disable cookies from domains I have removed cookies from" turned on. So moodle was correct in my instance.
        Hide
        Ken Wilson added a comment -

        Thanks for the useful info on this. Now closed.

        Show
        Ken Wilson added a comment - Thanks for the useful info on this. Now closed.
        Hide
        Joacim Breiler added a comment -

        Sorry for bringing this up again!

        It's wierd, many of our students are complaining that they can't login, and with the same symptoms. I could reproduce the problem as well, if I tried to access a page (with emptied cookie) using a direct link, resulting in that MOODLEID_ isn't created.

        We are running Moodle 1.6.3+.

        In /login/index.php on line 247 there is a check for the MOODLEID_ cookie:

        if (get_moodle_cookie() == '')

        { set_moodle_cookie('nobody'); // To help search for cookies }

        I managed to resolve the problem by moving that check sequence further up in /login/index.php.

        I'm suspecting that there is somthing being written to the page before the headers are completly sent,
        resulting in that the cookie isn't created.

        Could this be right?

        Show
        Joacim Breiler added a comment - Sorry for bringing this up again! It's wierd, many of our students are complaining that they can't login, and with the same symptoms. I could reproduce the problem as well, if I tried to access a page (with emptied cookie) using a direct link, resulting in that MOODLEID_ isn't created. We are running Moodle 1.6.3+. In /login/index.php on line 247 there is a check for the MOODLEID_ cookie: if (get_moodle_cookie() == '') { set_moodle_cookie('nobody'); // To help search for cookies } I managed to resolve the problem by moving that check sequence further up in /login/index.php. I'm suspecting that there is somthing being written to the page before the headers are completly sent, resulting in that the cookie isn't created. Could this be right?

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: