Skip to content

Commit

Permalink
Optimise session init
Browse files Browse the repository at this point in the history
  • Loading branch information
slackero committed Sep 9, 2021
1 parent 3fc90dc commit 69b4c55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions include/inc_lib/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,13 +953,10 @@ function _initSession() {
$GLOBALS['phpwcms']['session_cookie_params']['httponly'] = empty($GLOBALS['phpwcms']['session.cookie_httponly.off']) ? true : false;
$GLOBALS['phpwcms']['session_cookie_params']['domain'] = $GLOBALS['phpwcms']['parse_url']['host'];
$GLOBALS['phpwcms']['session_cookie_params']['path'] = PHPWCMS_BASEPATH;
if (empty($GLOBALS['phpwcms']['session.cookie_samesite'])) {
$GLOBALS['phpwcms']['session_cookie_params']['secure'] = PHPWCMS_SSL;
if (PHPWCMS_SSL && empty($GLOBALS['phpwcms']['session_cookie_params']['samesite'])) {
$GLOBALS['phpwcms']['session_cookie_params']['samesite'] = 'Lax';
}
$GLOBALS['phpwcms']['session_cookie_params']['secure'] = PHPWCMS_SSL;
if (empty($GLOBALS['phpwcms']['session.cookie_samesite']) && empty($GLOBALS['phpwcms']['session_cookie_params']['samesite'])) {
$GLOBALS['phpwcms']['session_cookie_params']['samesite'] = PHPWCMS_SSL ? 'Lax' : 'None';
} else {
$GLOBALS['phpwcms']['session_cookie_params']['secure'] = true;
$GLOBALS['phpwcms']['session_cookie_params']['samesite'] = $GLOBALS['phpwcms']['session.cookie_samesite'];
}
@session_set_cookie_params($GLOBALS['phpwcms']['session_cookie_params']);
Expand Down
2 changes: 1 addition & 1 deletion include/inc_lib/revision/revision.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
**/

define('PHPWCMS_VERSION', '1.9.29-dev');
define('PHPWCMS_RELEASE_DATE', '2021/09/06');
define('PHPWCMS_RELEASE_DATE', '2021/09/09');
define('PHPWCMS_REVISION', '552');

0 comments on commit 69b4c55

Please sign in to comment.