PHP - Sessions and Cookies
Consider this PHP code:
What will be the output on the first page load?
<?php
session_start();
if (!isset($_SESSION['visits'])) {
$_SESSION['visits'] = 1;
} else {
$_SESSION['visits']++;
}
setcookie('visits', $_SESSION['visits'], time() + 3600);
echo $_COOKIE['visits'];
?>What will be the output on the first page load?
