Skip to content

Instantly share code, notes, and snippets.

@bagofarms
Last active July 30, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagofarms/3b2c714dbae6fcb651ad504e61eda630 to your computer and use it in GitHub Desktop.
Save bagofarms/3b2c714dbae6fcb651ad504e61eda630 to your computer and use it in GitHub Desktop.
This patch allows UDOIT to be used with Chrome's new secure-by-default cookie policy
// Patch for older versions of UDOIT to fix secure-by-default cookies in Chrome for cross-site cookies
// Place in config/settings.php directly under define('UDOIT_VERSION',....
$lifetime = 0;
$path = '/';
$domain = null;
$secure = true;
$httponly = false;
if (PHP_VERSION_ID < 70300) {
session_set_cookie_params($lifetime, "$path; samesite=None", $domain, $secure, $httponly);
} else {
session_set_cookie_params([
'lifetime' => $lifetime,
'path' => $path,
'domain' => $domain,
'samesite' => 'None',
'secure' => $secure,
'httponly' => $httponly,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment