Zubrag.com
January 17, 2018, 03:01:26 AM *
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]
  Print  
Author Topic: Setting another cookie not read til I refresh  (Read 1975 times)
gregston
Newbie
*
Posts: 1


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

Hi
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
Greg

Logged
Pages: [1]
  Print  
 
Jump to:  

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