seedproject-web/api/public/index.php

24 lines
676 B
PHP
Raw Permalink Normal View History

<?php
// Harden the session cookie before it is created (login state rides on it).
if (session_status() !== PHP_SESSION_ACTIVE) {
$https = (($_SERVER['HTTPS'] ?? '') !== '' && $_SERVER['HTTPS'] !== 'off')
|| ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https';
session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'httponly' => true,
'secure' => $https,
'samesite' => 'Lax',
]);
}
@session_start();
require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/config.php';
define('VIEWS_PATH', __DIR__);
$bootstrap = new Bootstrap();
$bootstrap->init();