Skip to content

Commit 63d1c00

Browse files
authored
Merge pull request #1488 from mambax7/feature/Lax
change samesite to Lax
2 parents 489e562 + 91a535c commit 63d1c00

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

htdocs/class/logger/render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function xoLogCreateCookie(name,value,days)
186186
date.setTime(date.getTime()+(days*24*60*60*1000));
187187
var expires = "; expires="+date.toGMTString();
188188
} else var expires = "";
189-
document.cookie = name+"="+value+expires+";path=/;samesite=strict;";
189+
document.cookie = name+"="+value+expires+";path=/;samesite=Lax;";
190190
}
191191
function xoLogReadCookie(name)
192192
{

htdocs/include/xoopssetcookie.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Richard Griffith <[email protected]>
1818
*
1919
* This exists to bring samesite support to php versions before 7.3, and
20-
* it treats the default as samesite=strict
20+
* it treats the default as samesite=Lax
2121
*
2222
* It supports both of the two declared signatures:
2323
* - setcookie ( string $name , string $value = "" , int $expires = 0 , string $path = "" , string $domain = "" , bool $secure = false , bool $httponly = false ) : bool
@@ -51,8 +51,8 @@ function xoops_setcookie()
5151
}
5252
}
5353

54-
// make samesite=strict the default
55-
$args['options']['samesite'] ??= 'strict';
54+
// make samesite=Lax the default
55+
$args['options']['samesite'] ??= 'Lax';
5656
if (!isset($args['value'])){
5757
$args['value'] = '';
5858
}

htdocs/install/include/common.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function fatalPhpErrorHandler($e = null) {
5757
'domain' => null,
5858
'secure' => false,
5959
'httponly' => true,
60-
'samesite' => 'strict',
60+
'samesite' => 'Lax',
6161
];
6262
// options for mainfile.php
6363
if (empty($xoopsOption['hascommon'])) {

htdocs/kernel/session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(XoopsDatabase $db)
8989
'domain' => XOOPS_COOKIE_DOMAIN,
9090
'secure' => $secure,
9191
'httponly' => true,
92-
'samesite' => 'strict',
92+
'samesite' => 'Lax',
9393
];
9494
session_set_cookie_params($options);
9595
} else {

htdocs/modules/system/js/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function system_createCookie(name, value, days) {
244244
var expires = "; expires=" + date.toGMTString();
245245
}
246246
else var expires = "";
247-
document.cookie = name + "=" + value + expires + ";path=/;samesite=strict;";
247+
document.cookie = name + "=" + value + expires + ";path=/;samesite=Lax;";
248248
}
249249
function system_readCookie(name) {
250250
var nameEQ = name + "=";

htdocs/modules/system/themes/default/js/styleswitch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function createCookie(name,value,days)
5151
var expires = "; expires="+date.toGMTString();
5252
}
5353
else var expires = "";
54-
document.cookie = name+"="+value+expires+";path=/;samesite=strict;";
54+
document.cookie = name+"="+value+expires+";path=/;samesite=Lax;";
5555
}
5656
function readCookie(name)
5757
{

htdocs/modules/system/themes/transition/js/styleswitch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function createCookie(name,value,days)
6969
var expires = "; expires="+date.toGMTString();
7070
}
7171
else var expires = "";
72-
document.cookie = name+"="+value+expires+";path=/;samesite=strict;";
72+
document.cookie = name+"="+value+expires+";path=/;samesite=Lax;";
7373
}
7474
function readCookie(name)
7575
{

htdocs/themes/xswatch4/js/cookieconsent.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

htdocs/themes/xswatch4/tpl/nav-admin.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
toolbar_cookie = 'off';
9090
xswatchToolbarIndOff();
9191
}
92-
Cookies.set('xswatch-toolbar', toolbar_cookie, { expires: 365, sameSite: 'strict' });
92+
Cookies.set('xswatch-toolbar', toolbar_cookie, { expires: 365, sameSite: 'Lax' });
9393
}
9494
// set initial conditions based on cookie
9595
var toolbar_cookie = Cookies.get('xswatch-toolbar');

0 commit comments

Comments
 (0)