PHP – Set and Read Cookies – setcookie()

Cookies allow you to set variables that are persistent between multiple visits to a website.

<?php

$cookie = "sdcookie";

$time = time();

setcookie($cookie, $time);

print "Current Time: $time";

print "</br>";

print "Previous Visit Time: $_COOKIE[sdcookie]";

?>

Be the first to comment

Leave a Reply