SymfonyComponentHttpFoundationSessionStorageSessionStorageInterface

StorageInterface.

Summary

No protected methods found
N/A
No private methods found
N/A

Methods

start()

start() : boolean

Starts the session.

Throws

RuntimeException

If something goes wrong starting the session.

Returns

boolean —

True if started.

Tags

api

isStarted()

isStarted() : boolean

Checks if the session is started.

Returns

boolean —

True if started, false otherwise.

Tags

None found

getId()

getId() : string

Returns the session ID

Returns

string —

The session ID or empty.

Tags

api

setId()

setId(string  $id) 

Sets the session ID

Parameters

string $id

Tags

api

getName()

getName() : mixed

Returns the session name

Returns

mixed —

The session name.

Tags

api

setName()

setName(string  $name) 

Sets the session name

Parameters

string $name

Tags

api

regenerate()

regenerate(Boolean  $destroy = false, integer  $lifetime = null) : Boolean

Regenerates id that represents this storage.

This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing.

Note regenerate destroy should not clear the session data in memory only delete the session data from persistent storage.

Parameters

Boolean $destroy

Destroy session when regenerating?

integer $lifetime

Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp.

Throws

RuntimeException

If an error occurs while regenerating this storage

Returns

Boolean —

True if session regenerated, false if error

Tags

api

save()

save() 

Force the session to be saved and closed.

This method must invoke session_write_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it it should actually persist the session data if required.

Throws

RuntimeException

If the session is saved without being started, or if the session is already closed.

Tags

None found

clear()

clear() 

Clear all session data in memory.

Tags

None found

getBag()

getBag(string  $name) : \Symfony\Component\HttpFoundation\Session\SessionBagInterface

Gets a SessionBagInterface by name.

Parameters

string $name

Throws

InvalidArgumentException

If the bag does not exist

Returns

SymfonyComponentHttpFoundationSessionSessionBagInterface

Tags

None found

registerBag()

registerBag(\Symfony\Component\HttpFoundation\Session\SessionBagInterface  $bag) 

Registers a SessionBagInterface for use.

Parameters

SymfonyComponentHttpFoundationSessionSessionBagInterface $bag

Tags

None found

getMetadataBag()

getMetadataBag() : \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag

Returns

SymfonyComponentHttpFoundationSessionStorageMetadataBag

Tags

None found