\Symfony\Component\HttpFoundation\Session\Storage\HandlerNullSessionHandler

NullSessionHandler.

Can be used in unit testing or in a situations where persisted sessions are not desired.

Summary

Methods
Properties
Constants
open()
close()
read()
write()
destroy()
gc()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

open()

open(string  $savePath, string  $sessionName) : boolean

Re-initializes existing session, or creates a new one.

Parameters

string $savePath

Save path

string $sessionName

Session name, see http://php.net/function.session-name.php

Returns

boolean —

true on success, false on failure

close()

close() : boolean

Closes the current session.

Returns

boolean —

true on success, false on failure

read()

read(string  $sessionId) : string

Reads the session data.

Parameters

string $sessionId

Session ID, see http://php.net/function.session-id

Returns

string —

Same session data as passed in write() or empty string when non-existent or on failure

write()

write(string  $sessionId, string  $data) : boolean

Writes the session data to the storage.

Care, the session ID passed to write() can be different from the one previously received in read() when the session ID changed due to session_regenerate_id().

Parameters

string $sessionId

Session ID , see http://php.net/function.session-id

string $data

Serialized session data to save

Returns

boolean —

true on success, false on failure

destroy()

destroy(string  $sessionId) : boolean

Destroys a session.

Parameters

string $sessionId

Session ID, see http://php.net/function.session-id

Returns

boolean —

true on success, false on failure

gc()

gc(string|integer  $maxlifetime) : boolean

Cleans up expired sessions (garbage collection).

Parameters

string|integer $maxlifetime

Sessions that have not updated for the last maxlifetime seconds will be removed

Returns

boolean —

true on success, false on failure