Last active
March 10, 2017 17:20
-
-
Save nikolaykrylov/d64d032e693d5a5155bdb6cd84ada8de to your computer and use it in GitHub Desktop.
Why cookie doesn't expire if I refresh page?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
setcookie("user", 'something', time() + 3); | |
if (isset($_COOKIE['user'])){ | |
echo "Wellcome, friend!"; | |
} | |
else echo "Wellcome, guest."; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment