\Symfony\Component\HttpFoundation\Session\Storage\ProxySessionHandlerProxy

SessionHandler proxy.

Summary

Methods
Properties
Constants
getSaveHandlerName()
isSessionHandlerInterface()
isWrapper()
isActive()
getId()
setId()
getName()
setName()
__construct()
open()
close()
read()
write()
destroy()
gc()
No public properties found
No constants found
No protected methods found
$wrapper
$active
$saveHandlerName
$handler
N/A
No private methods found
No private properties found
N/A

Properties

$wrapper

$wrapper : boolean

Flag if handler wraps an internal PHP session handler (using \SessionHandler).

Type

boolean

$active

$active : boolean

Type

boolean

$saveHandlerName

$saveHandlerName : string

Type

string

Methods

getSaveHandlerName()

getSaveHandlerName() : string

Gets the session.save_handler name.

Returns

string

isSessionHandlerInterface()

isSessionHandlerInterface() : boolean

Is this proxy handler and instance of \SessionHandlerInterface.

Returns

boolean

isWrapper()

isWrapper() : boolean

Returns true if this handler wraps an internal PHP session save handler using \SessionHandler.

Returns

boolean

isActive()

isActive() : boolean

Has a session started?

Returns

boolean

getId()

getId() : string

Gets the session ID.

Returns

string

setId()

setId(string  $id) 

Sets the session ID.

Parameters

string $id

Throws

\LogicException

getName()

getName() : string

Gets the session name.

Returns

string

setName()

setName(string  $name) 

Sets the session name.

Parameters

string $name

Throws

\LogicException

__construct()

__construct(\SessionHandlerInterface  $handler) 

Constructor.

Parameters

\SessionHandlerInterface $handler

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