Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/cookie/

cookie.php
cookie1.php
cookie2.php
cookie3.php
cookie3_hemligheter.php
cookie4.php
cookie5.php

cookie3_hemligheter.php

33 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>Hemligheter</title>
</head>
<body>
  <?php 
  session_start
();

  if (isset(
$_SESSION["user"]) && isset($_SESSION["pwd"])) {
    if (
$_SESSION["user"] != "Teo" || $_SESSION["pwd"] != "pommes52") {
      
header('Location: cookie3.php');
    }
  } else {
    
header('Location: cookie3.php');
  }
  
?>

  <h1>Hemligheter</h1>

  <p>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</p>

  <a href='cookie3.php'>Gå tillbaka</a>

  <form method="post" action="cookie3.php">
    <input name="kill" type="hidden" value="">

    <input type="submit" value="Log out">
  </form>
</body>
</html>