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
cookie3.php
32 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>
<?php
session_start();
if (isset($_POST["kill"])) {
session_destroy();
}
if (isset($_POST["user"]) && isset($_POST["pwd"])) {
$_SESSION["user"] = $_POST["user"];
$_SESSION["pwd"] = $_POST["pwd"];
}
?>
<form method="post" action="">
<input name="user" type="text">
<br>
<input name="pwd" type="password">
<br>
<input type="submit" value="Skicka">
</form>
<a href="cookie3_hemligheter.php">Gå till hemligheterna</a>
</body>
</html>