How to unset a coockie when closing the browser

0

In PHP I'm creating a login coockie like this:

$data = "e".gmdate("dmY");
setcookie("elogado", $data, time() + 600, "/");

When I close the browser and reopen, I will check the coockie like this:

if(isset($_COOKIE["elogado"])){
    echo "sim";
}

It falls into this if, that is, the coockie does not close when closing the browser. Is there any way to give unset when closing the browser and / or tab?

    
asked by anonymous 04.04.2018 / 19:27

0 answers