Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/exercises/cookies/

ovn_cok1.php
ovn_cok2.php
ovn_cok3_hemligheter.php
ovn_cok3_inloggning.php
ovn_cok4.php
ovn_cok5.php

ovn_cok1.php

27 lines UTF-8 Windows (CRLF)
<?php

    setcookie
("myCookie"1time() + 10);

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Övning Cookie 1</title>
</head>
<body>
    <?php
        
if(isset($_COOKIE["myCookie"])) {
            
?>
                Cookie set
            <?php
        
} else {
            
?>
                Cookie not set
            <?php
        
}
    
?>
</body>
</html>