Skip to content

Commit

Permalink
Refactor cookie samesite config check
Browse files Browse the repository at this point in the history
  • Loading branch information
slackero committed Dec 4, 2022
1 parent c1824d1 commit 9bd975f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/inc_lib/default.inc.php
Expand Up @@ -969,10 +969,10 @@ function _initSession() {
$GLOBALS['phpwcms']['session_cookie_params']['domain'] = $GLOBALS['phpwcms']['parse_url']['host'];
$GLOBALS['phpwcms']['session_cookie_params']['path'] = PHPWCMS_BASEPATH;
$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 {
if(isset($GLOBALS['phpwcms']['session.cookie_samesite'])) {
$GLOBALS['phpwcms']['session_cookie_params']['samesite'] = $GLOBALS['phpwcms']['session.cookie_samesite'];
} elseif(empty($GLOBALS['phpwcms']['session_cookie_params']['samesite'])) {
$GLOBALS['phpwcms']['session_cookie_params']['samesite'] = PHPWCMS_SSL ? 'Lax' : 'None';
}
@session_set_cookie_params($GLOBALS['phpwcms']['session_cookie_params']);

Expand Down

0 comments on commit 9bd975f

Please sign in to comment.