ENHANCEMENT: added security hardening

This commit is contained in:
Jeroen De Meerleer 2022-01-31 15:24:41 +01:00
parent 0ae17fd1d9
commit c9b109601a
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 6 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,12 @@ 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);
}