Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/submissions/projekt-quiz/

README.md
admin/
create_admin.php
create_quiz.php
css/
dashboard.php
debug_questions.php
includes/
index.php
leaderboard.php
login.php
logout.php
my_results.php
quiz.php
quiz_result.php
register.php
sqlcredentials

logout.php

19 lines UTF-8 Unix (LF)
<?php
session_start
();

// Ta bort alla session-variabler
$_SESSION = array();

// Om du vill ta bort session-cookien
if (isset($_COOKIE[session_name()])) {
    
setcookie(session_name(), ''time() - 3600'/');
}

// Förstör sessionen
session_destroy();

// Omdirigera till startsida
header("Location: index.php");
exit();
?>