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_cok2.php

28 lines UTF-8 Windows (CRLF)
<?php
session_start
();
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Övning Cookie 2</title>
</head>

<body>
    <?php
    
if (isset($_SESSION["time"])) {
        if (
time() > $_SESSION["time"]) {
            
$_SESSION["time"] = null;
        } else {
            echo 
'Välkommen tillbaka';
        }
    } else {
        
$_SESSION["time"] = (time() + 10);
        echo 
'Kom tillbaka innan 'time() + 10;
    }
    
?>
</body>

</html>