mirror of
https://github.com/typemill/typemill.git
synced 2025-10-17 15:46:28 +02:00
Version 1.1.7 Improve Session Management
This commit is contained in:
@@ -27,7 +27,6 @@ abstract class Controller
|
||||
if($this->c->request->getUri()->getScheme() == 'https')
|
||||
{
|
||||
$response = $response->withAddedHeader('Strict-Transport-Security', 'max-age=63072000');
|
||||
$response = $response->withAddedHeader('Content-Security-Policy', 'default-src https:');
|
||||
}
|
||||
|
||||
$response = $response->withAddedHeader('X-Content-Type-Options', 'nosniff');
|
||||
|
@@ -26,7 +26,7 @@ class Settings
|
||||
|
||||
return [
|
||||
'determineRouteBeforeAppMiddleware' => true,
|
||||
'displayErrorDetails' => true,
|
||||
'displayErrorDetails' => false,
|
||||
'title' => 'TYPEMILL',
|
||||
'author' => 'Unknown',
|
||||
'copyright' => 'Copyright',
|
||||
@@ -43,7 +43,7 @@ class Settings
|
||||
'contentFolder' => 'content',
|
||||
'cache' => true,
|
||||
'cachePath' => $rootPath . 'cache',
|
||||
'version' => '1.1.6',
|
||||
'version' => '1.1.7',
|
||||
'setup' => true,
|
||||
'welcome' => true
|
||||
];
|
||||
|
@@ -103,15 +103,15 @@ $container['assets'] = function($c)
|
||||
* DECIDE FOR SESSION *
|
||||
************************/
|
||||
|
||||
$session_segments = array('setup/', 'tm/');
|
||||
$session_segments = array('setup', 'tm/', '/setup', '/tm/');
|
||||
$path = $container['request']->getUri()->getPath();
|
||||
$container['flash'] = false;
|
||||
$container['csrf'] = false;
|
||||
|
||||
foreach($session_segments as $segment)
|
||||
{
|
||||
{
|
||||
if(substr( $path, 0, strlen($segment) ) === $segment)
|
||||
{
|
||||
{
|
||||
/* start a session */
|
||||
ini_set( 'session.cookie_httponly', 1 );
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
@@ -140,8 +140,6 @@ foreach($session_segments as $segment)
|
||||
{
|
||||
return new \Slim\Flash\Messages();
|
||||
};
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user