December 10, 2018, 08:42:54 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
Author Topic: Setting another cookie not read til I refresh  (Read 2413 times)
Posts: 1

« on: November 08, 2011, 05:42:20 AM »

I'm using password_protect which works fine. I want to set another cookie so I know which particular user has logged in, so I've added this bottom line:
 else {
    // set cookie if password was validated
    setcookie("verify", md5($login.'%'.$pass), $timeout, '/');
    setcookie("id", $login, $timeout, '/');

But when I try to read this in the next page (the one that the include pp line is at the top of) I can't unless I refresh the page. I think it's something to do with the headers not being resent or something - is there a way round this? Or is there another way to know the login info?  I could use $id = $_POST['access_login']; but that won't survive through different pages will it?
Many thanks

Pages: [1]
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC