Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions fp-includes/core/core.cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ function sess_setup() {
// Activate strict mode to prevent session fixation attacks
ini_set('session.use_strict_mode', 1);

// Set session timeout duration (e.g., 3600 seconds = 60 minutes)
$timeout_duration = 3600;
ini_set('session.gc_maxlifetime', $timeout_duration);

// Optimize Garbage Collection (adjust to session load)
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 50);

$session_cookie_options = get_cookie_options(0, true);

// Set session cookie parameters based on PHP version
Expand All @@ -110,9 +118,6 @@ function sess_setup() {
'; HttpOnly; SameSite=' . SAMESITE_VALUE);
}

// Set timeout duration in seconds (e.g., 3600 seconds = 60 minutes)
$timeout_duration = 3600;

if (isset($_SESSION ['last_activity'])) {
// Check if the session has expired
if (time() - $_SESSION ['last_activity'] > $timeout_duration) {
Expand Down
2 changes: 1 addition & 1 deletion fp-includes/core/core.language.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function set_locale() {
$supportedLocales = [];
if (function_exists('shell_exec') && is_callable('shell_exec')) {
// Checks the supported locales with locale -a and only uses valid combinations
$output = shell_exec('locale -a');
$output = shell_exec('timeout 5s locale -a');
if ($output !== null) {
$supportedLocales = explode("\n", trim($output));
}
Expand Down