initial commit
This commit is contained in:
17
logout.php
Executable file
17
logout.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
session_start(); // Session starten, bevor man sie zerstört
|
||||
|
||||
// Alle Session-Daten löschen
|
||||
$_SESSION = array();
|
||||
|
||||
// Cookies löschen, indem ihr Verfallsdatum in die Vergangenheit gesetzt wird
|
||||
setcookie('auth_token', '', time() - 3600, "/");
|
||||
setcookie('user_id', '', time() - 3600, "/");
|
||||
|
||||
// Session zerstören
|
||||
session_destroy();
|
||||
|
||||
// Weiterleitung zur Login-Seite
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
Reference in New Issue
Block a user