This commit is contained in:
2025-12-01 01:19:25 +01:00
parent c2db8ddb63
commit 7eb0994abe
2 changed files with 28 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ function router_v1_dispatch(array $segments): void
$handler = 'browser_quick_test_handle_request';
break;
// 🔎 NEU: Debug-Endpoint für Session / Cookies
case 'debug.session':
$file = $apibasedir . '/v1/debug/debug.session.php';
$handler = 'debug_session_handle_request';
break;
default:
http_response_code(404);
echo json_encode([

View File

@@ -0,0 +1,22 @@
<?php
// /api/v1/debug/debug.session.php
declare(strict_types=1);
function debug_session_handle_request(): array
{
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
return [
'ok' => true,
'session_id' => session_id(),
'session' => $_SESSION,
'cookies' => $_COOKIE,
'server' => [
'host' => $_SERVER['HTTP_HOST'] ?? null,
'uri' => $_SERVER['REQUEST_URI'] ?? null,
],
];
}