i am trying this code:
setcookie('email', $first_email, 'hash', $this->hash, 'logout', $this->log, time()+60*60*24*100);
but i got: Warning: setcookie() expects parameter 3 to be long,
I want setcookie with multiple variables. How can be done ? maybe an array ?
Then i will have something like this, that is compared with values in database
if(empty($_COOKIE['email']) || empty($_COOKIE['hash']) || empty($_COOKIE['logout'])) {
//something
}
else
//db
You cannot assign 3 different cookies in one function call. You need to set each cookie individually, as can be seen below: