class NativeFileSessionHandler extends SessionHandler (View source)

NativeFileSessionHandler.

Native session handler using PHP's built in file storage, with open_basedir restriction checking.

Copied from Symfony's NativeFileSessionHandler and added in some exception handling.

Default PHP config usually puts the session data in a global directory which the runtime should have no access to. Those directories should be able to be warded off for security reasons using open_basedir restrictions. By testing the existence of that directory such a restriction is useless as it will always generate a fatal error.

Methods

__construct(string $savePath = null)

Constructor.

Details

__construct(string $savePath = null)

Constructor.

Parameters

string $savePath

Path of directory to save session files. Default null will leave setting as defined by PHP. '/path', 'N;/path', or 'N;octal-mode;/path

Exceptions

InvalidArgumentException

See also

http://php.net/session.configuration.php#ini.session.save-path for further details.