<?php
$_SERVER['REQUEST_METHOD'] = 'GET';
define('BASE_PATH', __DIR__);
define('DS', DIRECTORY_SEPARATOR);
require __DIR__ . '/autoload.php';
require __DIR__ . '/config/app.php';

\core\Session::start();
echo "SID: " . session_id() . "\n";
echo "Init: " . (isset($_SESSION['_initialized']) ? 'yes' : 'no') . "\n";
echo "Flash before: " . (isset($_SESSION['_flash']) ? count($_SESSION['_flash']) : 0) . "\n";

// Simulate what redirectWith does
\core\Session::setAlert('success', 'TEST MESSAGE');
echo "Flash after set: " . count($_SESSION['_flash']) . "\n";
echo "Keys: " . json_encode(array_keys($_SESSION['_flash'])) . "\n";

// Then read back like getAlerts
$alerts = \core\Session::getAlerts();
echo "Alerts found: " . count($alerts) . "\n";
foreach ($alerts as $a) { echo "  {$a['type']}: {$a['message']}\n"; }
