Log out with a POST form.

The logout link put the CSRF token in the URL, which goes into logs and the browser history.
This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent 061f9c1a37
commit 71f768bff2
5 changed files with 38 additions and 10 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ header( 'Pragma: no-cache' );
include_once('../session.lib.php');
require_once('../config.lib.php');
require_https();
// Only log out from our own logout link, which carries the CSRF token
if (!csrf_valid($_GET['token'] ?? '')) {
// Only log out from our own logout form, which posts the CSRF token
if (!csrf_valid()) {
header("Location: /");
exit;
}