Hi I'm trying to make a cookie that will remeber a login but it says: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
. Can some one please help me?
The code that doesn't work is:
if(isset($_COOKIE['user']['id'] && !empty(isset($_COOKIE['user']['id']))){
...
}
i edited the code to: if (isset ($_logincookie['cookie_user'] && !empty($_logincookie['cookie_user']))){
but still the same problem
Pay attention to the brackets. Also.. there is no need for isset
and empty
to be used on the same variable. empty
verifies also if the variable is set:
if(!empty($_COOKIE['user']['id'])){
// do something
}