function MockFileSessionStorage::__construct
Parameters
string|null $savePath Path of directory to save session files:
Overrides MockArraySessionStorage::__construct
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ MockFileSessionStorage.php, line 33
Class
- MockFileSessionStorage
- MockFileSessionStorage is used to mock sessions for functional testing where you may need to persist session data across separate PHP processes.
Namespace
Symfony\Component\HttpFoundation\Session\StorageCode
public function __construct(?string $savePath = null, string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null) {
$savePath ??= sys_get_temp_dir();
if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) {
throw new \RuntimeException(\sprintf('Session Storage was not able to create directory "%s".', $savePath));
}
$this->savePath = $savePath;
parent::__construct($name, $metaBag);
}