aboutsummaryrefslogtreecommitdiff
path: root/public/logout.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/logout.php')
-rw-r--r--public/logout.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/public/logout.php b/public/logout.php
new file mode 100644
index 0000000..094ee22
--- /dev/null
+++ b/public/logout.php
@@ -0,0 +1,9 @@
+<?php
+$prev = $_COOKIE['prev'];
+if (!$prev) $prev = "/";
+http_response_code(302);
+setcookie("prev", null, -1, "/");
+setcookie("username", null, -1, "/");
+setcookie("password", null, -1, "/");
+header("Location: ".$prev);
+?>