Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/cookie/

cookie.html
ovn_cookie1.php
ovn_cookie2.php

ovn_cookie1.php

21 lines UTF-8 Windows (CRLF)
<?php
setcookie
("testcookie","Kalle Anka",time()+(60*60), "/"false0);
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
<?php 
if (isset($_COOKIE['testcookie'])) {
    echo 
"<p>Välkommen tillbaka!</p>";
} else {
    echo 
"<p>Välkommen</p>";
}
?>
</body>
</html>