Merge pull request #4025 from IgorA100/patch-108

When save cookies via PHP >= 7.3.0, add handling of the "path" value in the options (session.php)
pull/4202/head
Isaac Connor 2024-05-22 08:58:26 -04:00 committed by Isaac Connor
parent 101bf62a29
commit efcf5f6cec
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,9 @@
<?php <?php
// Wrapper around setcookie that auto-sets samesite, and deals with older versions of php // Wrapper around setcookie that auto-sets samesite, and deals with older versions of php
function zm_setcookie($cookie, $value, $options=array()) { function zm_setcookie($cookie, $value, $options=array()) {
if (!isset($options['path'])) {
$options['path'] = '/';
}
if (!isset($options['expires'])) { if (!isset($options['expires'])) {
$options['expires'] = time()+3600*24*30*12*10; // 10 years?! $options['expires'] = time()+3600*24*30*12*10; // 10 years?!
} }