mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-19 12:06:29 -04:00
When setting cookies via PHP, add handling of the "path" value in the options (session.php)
Otherwise, cookies set via PHP will not be able to be changed in JS. Because JS saves cookies with path="/" Closed: #4024
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
// Wrapper around setcookie that auto-sets samesite, and deals with older versions of php
|
||||
function zm_setcookie($cookie, $value, $options=array()) {
|
||||
if (!isset($options['path'])) {
|
||||
$options['path'] = '/';
|
||||
}
|
||||
if (!isset($options['expires'])) {
|
||||
$options['expires'] = time()+3600*24*30*12*10; // 10 years?!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user