fix(session): initialize data lazily in save() to prevent uninitialized property access (#252)
This commit is contained in:
parent
a98e01a4be
commit
61c20f1450
1 changed files with 10 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ class Session implements SessionInterface
|
|||
|
||||
public function save(): bool
|
||||
{
|
||||
return $this->store->write($this->id, json_encode($this->data, \JSON_THROW_ON_ERROR));
|
||||
return $this->store->write($this->id, json_encode($this->readData(), \JSON_THROW_ON_ERROR));
|
||||
}
|
||||
|
||||
public function get(string $key, mixed $default = null): mixed
|
||||
|
|
|
|||
Loading…
Reference in a new issue