Skip to content

Instantly share code, notes, and snippets.

@nikolaykrylov
Last active March 10, 2017 17:20
Show Gist options
  • Save nikolaykrylov/d64d032e693d5a5155bdb6cd84ada8de to your computer and use it in GitHub Desktop.
Save nikolaykrylov/d64d032e693d5a5155bdb6cd84ada8de to your computer and use it in GitHub Desktop.
Why cookie doesn't expire if I refresh page?
<?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