class SessionSection implements IteratorAggregate, ArrayAccess

Session section.

Properties

$warnOnUndefined

Methods

__construct(Session $session, string $name)

Do not call directly. Use Session::getSection().

getIterator()

Returns an iterator over all section variables.

void
set(string $name, mixed $value, string|null $expire = null)

Sets a variable in this session section.

mixed
get(string $name)

Gets a variable from this session section.

void
remove(string|array|null $name = null)

Removes a variable or whole section.

void
__set(string $name, $value) deprecated

Sets a variable in this session section.

mixed
__get(string $name) deprecated

Gets a variable from this session section.

bool
__isset(string $name) deprecated

Determines whether a variable in this session section is set.

void
__unset(string $name) deprecated

Unsets a variable in this session section.

void
offsetSet($name, $value) deprecated

Sets a variable in this session section.

mixed
offsetGet($name) deprecated

Gets a variable from this session section.

bool
offsetExists($name) deprecated

Determines whether a variable in this session section is set.

void
offsetUnset($name) deprecated

Unsets a variable in this session section.

setExpiration(string|null $expire, string|array|null $variables = null)

Sets the expiration of the section or specific variables.

void
removeExpiration(string|array|null $variables = null)

Removes the expiration from the section or specific variables.

Details

at line 28
__construct(Session $session, string $name)

Do not call directly. Use Session::getSection().

Parameters

Session $session
string $name

at line 38
Iterator getIterator()

Returns an iterator over all section variables.

Return Value

Iterator

at line 48
void set(string $name, mixed $value, string|null $expire = null)

Sets a variable in this session section.

Parameters

string $name
mixed $value
string|null $expire

Return Value

void

at line 63
mixed get(string $name)

Gets a variable from this session section.

Parameters

string $name

Return Value

mixed

at line 78
void remove(string|array|null $name = null)

Removes a variable or whole section.

Parameters

string|array|null $name

Return Value

void

at line 100
void __set(string $name, $value) deprecated

deprecated use set() instead

Sets a variable in this session section.

Parameters

string $name
$value

Return Value

void

at line 111
mixed __get(string $name) deprecated

deprecated use get() instead

Gets a variable from this session section.

Parameters

string $name

Return Value

mixed

at line 127
bool __isset(string $name) deprecated

deprecated use get() instead

Determines whether a variable in this session section is set.

Parameters

string $name

Return Value

bool

at line 138
void __unset(string $name) deprecated

deprecated use remove() instead

Unsets a variable in this session section.

Parameters

string $name

Return Value

void

at line 148
void offsetSet($name, $value) deprecated

deprecated use set() instead

Sets a variable in this session section.

Parameters

$name
$value

Return Value

void

at line 158
mixed offsetGet($name) deprecated

deprecated use get() instead

Gets a variable from this session section.

Parameters

$name

Return Value

mixed

at line 168
bool offsetExists($name) deprecated

deprecated use get() instead

Determines whether a variable in this session section is set.

Parameters

$name

Return Value

bool

at line 178
void offsetUnset($name) deprecated

deprecated use remove() instead

Unsets a variable in this session section.

Parameters

$name

Return Value

void

at line 188
SessionSection setExpiration(string|null $expire, string|array|null $variables = null)

Sets the expiration of the section or specific variables.

Parameters

string|null $expire
string|array|null $variables

list of variables / single variable to expire

Return Value

SessionSection

at line 215
void removeExpiration(string|array|null $variables = null)

Removes the expiration from the section or specific variables.

Parameters

string|array|null $variables

list of variables / single variable to expire

Return Value

void