Show sourcecode
The following files exists in this folder. Click to view.
cookie.php
cookie1.php
cookie2.php
cookie3.php
cookie3_hemligheter.php
cookie4.php
cookie5.php
cookie2.php
27 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cookies-Session</title>
</head>
<body>
<p>
<?php
session_start();
if (isset($_SESSION["time"])) {
if ($_SESSION["time"] > time() - 60) {
echo "Välkommen tillbaka!";
} else {
echo "Hej!";
session_destroy();
}
} else {
echo "Hej!";
$_SESSION["time"] = time();
}
?>
</p>
</body>
</html>