class SessionSection implements IteratorAggregate, ArrayAccess

Session section.

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. Passing null removes it.

mixed
get(string $name)

Gets a variable from this session section.

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

Removes a variable or a list of variables from this section. With no argument, removes the entire section.

void
__set(string $name, mixed $value)

No description

mixed
__get(string $name)

No description

bool
__isset(string $name)

No description

void
__unset(string $name)

No description

void
offsetSet($name, $value)

No description

mixed
offsetGet($name)

No description

bool
offsetExists($name)

No description

void
offsetUnset($name)

No description

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

Sets the expiration time for the whole section or for specific variables.

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

Removes the expiration from the whole section or from specific variables.

Details

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

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

Parameters

Session $session
string $name

at line 34
Iterator getIterator()

Returns an iterator over all section variables.

Return Value

Iterator

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

Sets a variable in this session section. Passing null removes it.

The optional $expire sets per-variable expiration as a time string (e.g. '30 seconds').

Parameters

string $name
mixed $value
string|null $expire

Return Value

void

at line 60
mixed get(string $name)

Gets a variable from this session section.

Parameters

string $name

Return Value

mixed

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

Removes a variable or a list of variables from this section. With no argument, removes the entire section.

Parameters

string|array|null $name

Return Value

void

at line 93
void __set(string $name, mixed $value)

No description

Parameters

string $name
mixed $value

Return Value

void

at line 102
mixed __get(string $name)

No description

Parameters

string $name

Return Value

mixed

at line 112
bool __isset(string $name)

No description

Parameters

string $name

Return Value

bool

at line 121
void __unset(string $name)

No description

Parameters

string $name

Return Value

void

at line 129
void offsetSet($name, $value)

No description

Parameters

$name
$value

Return Value

void

at line 138
mixed offsetGet($name)

No description

Parameters

$name

Return Value

mixed

at line 146
bool offsetExists($name)

No description

Parameters

$name

Return Value

bool

at line 154
void offsetUnset($name)

No description

Parameters

$name

Return Value

void

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

Sets the expiration time for the whole section or for specific variables.

Pass null to clear the expiration.

Parameters

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

variable name(s) to apply the expiration to; null applies to the whole section

Return Value

SessionSection

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

Removes the expiration from the whole section or from specific variables.

Parameters

string|array|null $variables

variable name(s) to clear expiration for; null applies to the whole section

Return Value

void