- Fixed some bug related to path and domain options

This commit is contained in:
mcndave committed 2021-10-22 14:33:14 +00:00
1 parent 13a6c48316
commit ad51a435df
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ namespace Storage;
class Cookie { class Cookie {
protected array $options = [ public array $options = [
'expires' => 0, 'expires' => 0,
'path' => null, 'path' => null,
'domain' => null, 'domain' => null,
+1 -1
View File
@@ -33,7 +33,7 @@ class SessionMiddleware implements MiddlewareInterface
$options['name'] = md5(__FILE__); $options['name'] = md5(__FILE__);
} }
$this->options = array_merge($this->options, $options); $this->options = array_merge($this->options, array_filter(array_intersect_key($this->cookie->options, array_flip(['path', 'domain', 'samesite']))), $options);
$this->savePath = $savePath ?? sys_get_temp_dir(); $this->savePath = $savePath ?? sys_get_temp_dir();
} }