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

cookie1.php

20 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 
    
if (isset($_COOKIE["recent"])) {
      echo 
"Välkommen tillbaka!";
    } else {
      echo 
"Hej!";
      
setcookie("recent""recent"time() + 5);
    }
  
?>
  </p>
</body>
</html>