<?php

declare(strict_types=1);

header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet, noimageindex', true);
header('Referrer-Policy: same-origin', true);

/*
 * Sécurisation du cookie de session.
 * Secure sera activé automatiquement en HTTPS.
 */
$isHttps =
    !empty($_SERVER['HTTPS'])
    && $_SERVER['HTTPS'] !== 'off';

session_set_cookie_params([
    'lifetime' => 0,
    'path' => '/',
    'domain' => '',
    'secure' => $isHttps,
    'httponly' => true,
    'samesite' => 'Lax',
]);

if (
    session_status()
    !== PHP_SESSION_ACTIVE
) {
    session_start();
}

require_once __DIR__ . '/../bootstrap/app.php';

use App\Core\Router;

$router = new Router();
require_once __DIR__ . '/../routes/web.php';
$router->dispatch();
