Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/cookie-session/

ovn_cook1.php
ovn_cook2.php
ovn_cook3.php
ovn_cook3hem.php
ovn_cook4.php
ovn_cook5.php

ovn_cook1.php

25 lines UTF-8 Windows (CRLF)
<?php
setcookie
("testcookie","välkommen",time()+3600"/");
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cookie-Session 1</title>
</head>
<body>
  <?php
  
if (isset($_COOKIE['testcookie'])) {
    echo 
"Välkommen tillbaka till Övning 1";
  }
  else {
    echo 
"Välkommen till Övning 1";
  }
  
  
?>
  
</body>
</html>