ENHANCEMENT: added security hardening

This commit is contained in:
Jeroen De Meerleer 2022-01-31 15:25:08 +01:00
parent 850dbe3a66
commit 21f1d180ad
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,5 @@
<?php
session_start();
require_once "vendor/autoload.php";
if( ini_get('safe_mode') ){

View File

@ -100,6 +100,13 @@ class Kernel
$this->router = new Router();
$this->router->parseRoutes($this->getConfigDir(), 'routes.yaml');
$request = $this->parseRequest();
if($request->isSecure()) {
ini_set('session.cookie_httponly', true);
ini_set('session.cookie_secure', true);
}
session_start();
return $this->router->route($request, $this);
}