Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/ovning7/

dininloggningssida.php
index.html
ovn_cook1.php
ovn_cook2.php
ovn_cook3.php
ovn_cook4.php
ovn_cook5.php

ovn_cook2.php

31 lines UTF-8 Windows (CRLF)
    <?php
    session_start
();
    if (!isset(
$_SESSION["time"])){
        
$_SESSION["time"] = time();
    }
    if(
time()-$_SESSION["time"] > 10)  
    {
        
session_unset();
        
session_destroy();
    }
    
?>
    <!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($_SESSION["time"])) {
               echo 
"Välkommen Tillbaka!";
           } else {
               echo 
"Välkommen!";
           }
        
?>
    </body>

    </html>