From 3354d45762bbe0db33e3d26d8997e6f6624f24d7 Mon Sep 17 00:00:00 2001 From: winter Sparkles Date: Sun, 9 Aug 2026 02:26:33 +0100 Subject: implement sessions and also log in/out session data is stored in sqlite, not using php sessions --- routes/logout.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 routes/logout.php (limited to 'routes/logout.php') diff --git a/routes/logout.php b/routes/logout.php new file mode 100644 index 0000000..21b2179 --- /dev/null +++ b/routes/logout.php @@ -0,0 +1,24 @@ +getIdentity() === null) { + // not actually logged in anyway + header('Location: /'); + return; + } + + $resp = new Psso\XMLResponse; + $resp->doc->addAttribute('title', L('logout.title')); + $form = $resp->doc->addChild('form'); + $form->addChild('p', L('logout.warning')); + $form->addAttribute('method', 'post'); + $form->addChild('button', L('logout.confirm')); + $resp->send(); +} + +function POST() { + $session = Psso\Session::get(); + $session->setIdentity(null); + header('Location: /'); +} -- cgit v1.3