\Symfony\Component\HttpFoundation\Session\StorageMetadataBag

Metadata container.

Adds metadata to the session.

Summary

Methods
Properties
Constants
__construct()
initialize()
getLifetime()
stampNew()
getStorageKey()
getCreated()
getLastUsed()
clear()
getName()
setName()
No public properties found
CREATED
UPDATED
LIFETIME
No protected methods found
$meta
N/A
stampCreated()
$name
$storageKey
$lastUsed
$updateThreshold
N/A

Constants

CREATED

CREATED = 'c'

UPDATED

UPDATED = 'u'

LIFETIME

LIFETIME = 'l'

Properties

$meta

$meta : array

Type

array

$name

$name : string

Type

string

$storageKey

$storageKey : string

Type

string

$lastUsed

$lastUsed : int

Unix timestamp.

Type

int

$updateThreshold

$updateThreshold : int

Type

int

Methods

__construct()

__construct(string  $storageKey = '_sf2_meta', int  $updateThreshold) : mixed

Parameters

string $storageKey

The key used to store bag in the session

int $updateThreshold

The time to wait between two UPDATED updates

Returns

mixed —

initialize()

initialize(array  $array) : mixed

Initializes the Bag.

Parameters

array $array

Returns

mixed —

getLifetime()

getLifetime() : int

Gets the lifetime that the session cookie was set with.

Returns

int —

stampNew()

stampNew(int|null  $lifetime = null) : mixed

Stamps a new session's metadata.

Parameters

int|null $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.

Returns

mixed —

getStorageKey()

getStorageKey() : string

Gets the storage key for this bag.

Returns

string —

getCreated()

getCreated() : int

Gets the created timestamp metadata.

Returns

int —

Unix timestamp

getLastUsed()

getLastUsed() : int

Gets the last used metadata.

Returns

int —

Unix timestamp

clear()

clear() : mixed

Clears out data from bag.

Returns

mixed —

Whatever data was contained

getName()

getName() : string

Gets this bag's name.

Returns

string —

setName()

setName(string  $name) : mixed

Sets name.

Parameters

string $name

Returns

mixed —

stampCreated()

stampCreated(int  $lifetime = null) : void

Parameters

int $lifetime