You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//getting cookie. The cookies were set fron sandbox.php. the cookie is set when the the browser sends a POST through the submit button it leaves a cookie in the browser for some specified duration of time.
$gender = $_COOKIE['gender'] ?? 'Unknown';
if($gender == 'Unknown'){
$finalResult = "We don't know what you are";
} else {
$finalResult = 'you are a ' . $gender;
}
?>
<div>
<h1>The Header from header.php</h1>
<li>Hello <?php echo htmlspecialchars($name); ?>. <?php echo htmlspecialchars($finalResult) ?> (this is the session variable)</li>