mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add HttpOnly, Secure, and Samesite session settings to config.conf (#7547)
* Add HttpOnly, Secure, and Samesite session settings to config.conf * Update upgrade_menu.php * Update upgrade.php * Update upgrade.php * Update install.php
This commit is contained in:
@@ -128,6 +128,11 @@
|
||||
$conf .= "php.dir = ".$php_dir."\n";
|
||||
$conf .= "php.bin = php\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#session settings\n";
|
||||
$conf .= "session.cookie_httponly = true\n";
|
||||
$conf .= "session.cookie_secure = true\n";
|
||||
$conf .= "session.cookie_samesite = Lax\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#cache settings\n";
|
||||
$conf .= "cache.method = file\n";
|
||||
$conf .= "cache.location = ".$cache_location."\n";
|
||||
|
||||
@@ -112,6 +112,11 @@
|
||||
$conf .= "php.dir = ".$php_dir."\n";
|
||||
$conf .= "php.bin = php\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#session settings\n";
|
||||
$conf .= "session.cookie_httponly = true\n";
|
||||
$conf .= "session.cookie_secure = true\n";
|
||||
$conf .= "session.cookie_samesite = Lax\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#cache settings\n";
|
||||
$conf .= "cache.method = file\n";
|
||||
$conf .= "cache.location = ".$cache_location."\n";
|
||||
@@ -627,7 +632,7 @@ function update_file_permissions($text, settings $settings) {
|
||||
|
||||
//skip /dev/shm directory
|
||||
if (strpos($dir, '/dev/shm') !== false) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
//execute
|
||||
@@ -709,4 +714,3 @@ function find_service_name(string $file) {
|
||||
function is_root(): bool {
|
||||
return posix_getuid() === 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -537,6 +537,11 @@ function load_config_php() {
|
||||
$conf .= "php.dir = " . PHP_BINDIR . "\n";
|
||||
$conf .= "php.bin = php\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#session settings\n";
|
||||
$conf .= "session.cookie_httponly = true\n";
|
||||
$conf .= "session.cookie_secure = true\n";
|
||||
$conf .= "session.cookie_samesite = Lax\n";
|
||||
$conf .= "\n";
|
||||
$conf .= "#cache settings\n";
|
||||
$conf .= "cache.method = file\n";
|
||||
$conf .= "cache.location = /var/cache/fusionpbx\n";
|
||||
|
||||
@@ -91,9 +91,9 @@
|
||||
//start the session if not using the command line
|
||||
global $no_session;
|
||||
if (!defined('STDIN') && empty($no_session)) {
|
||||
ini_set('session.cookie_httponly', 'true');
|
||||
ini_set('session.cookie_secure', 'true');
|
||||
ini_set('session.cookie_samesite', 'Lax');
|
||||
ini_set('session.cookie_httponly', !isset($conf['session.cookie_httponly']) ? 'true' : (!empty($config->get('session.cookie_httponly')) ? 'true' : 'false'));
|
||||
ini_set('session.cookie_secure', !isset($conf['session.cookie_secure']) ? 'true' : (!empty($config->get('session.cookie_secure')) ? 'true' : 'false'));
|
||||
ini_set('session.cookie_samesite', $config->get('session.cookie_samesite', 'Lax'));
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user