Menu

Cookie not saving

Help
2001-05-23
2001-05-25
  • Charles Johnson

    Charles Johnson - 2001-05-23

    I've got authlib installed at http://www.fahrvergnugen.net/authlib/, and it's interacting with the database no problem.  (try testing with username demo pwd. demo)
    The problem I'm having is that it doesn't seem to be writing out the cookies to the browser.
    I register, receive the e-mail, and authenticate my registration without problem.
    When I go to log in, it verifies the username and password, and then admin.php tells me that I need to be logged in to view the page.

    I changed nologin.html and added what I think is a functional bit of check code:

                                    if (isset ($hello)) {
                                     while (list ($name, $value) = each ($hello)) {
                                      echo "$name == $value<br>\n";
                                     }  
                                    }
                                    else{
                                     echo "Goddamned cookie isn't set.<br>\n";
                                    }

    And it returns with the cookie not set every time.

    So the scripts are interacting with the database.

    In a fit of irritation, I wrote a quick cookie test script at
    http://www.fahrvergnugen.net/authadmin/cookietest.php that writes 3 cookies then reads them back to you using setcookie(), and it works fine.

    I'm at a loss.  Help!

     
    • Charles Johnson

      Charles Johnson - 2001-05-23
       
    • Michael

      Michael - 2001-05-25

      Hi!
      I had a similar problem. Some Browsers didnt the cookie at all. I solved this by increasing the ttl for the cookie to more than 7200.
      e.g.
      setcookie("example", "$email:$hash:$id", time()+8000);

      Maybe thats your problem?

      regards,
      spindi

       
    • Charles Johnson

      Charles Johnson - 2001-05-25

      Well, I tried omitting the time entirely and leaving it a browser-session-only cookie, and this seems to have worked quite nicely.  I'll try cranking the expire up a little bit and see what happens.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.