Jump to content

Cookies


adam84

Recommended Posts

This is my code for setting a cookie, but for some reason it is not getting set. Any questions?

 

   function login($userID, $userNameVal, $remember){
      $this->userid = $_SESSION['userid'] = $userID;
      $this->userName = $_SESSION['userName'] = $userNameVal;
$this->logged_in = $_SESSION['logged_in'] = true;
$t = time()+(60*60*24*100);

      if($remember){
         setcookie("cookname", $userNameVal, $t ,"/");
         setcookie("cookid",   $userID, $t, "/");
      }
   }

Link to comment
https://forums.phpfreaks.com/topic/43562-cookies/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.