asdsad
This commit is contained in:
@@ -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([
|
||||
|
||||
22
api/v1/debug/debug.session.php
Normal file
22
api/v1/debug/debug.session.php
Normal 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,
|
||||
],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user