SessionSection
class SessionSection implements IteratorAggregate, ArrayAccess
Session section.
Methods
Returns an iterator over all section variables.
Sets a variable in this session section.
Gets a variable from this session section.
Removes a variable or whole section.
Sets the expiration of the section or specific variables.
Removes the expiration from the section or specific variables.
Details
at line 30
__construct(Session $session, string $name)
Do not call directly. Use Session::getSection().
at line 40
Iterator
getIterator()
Returns an iterator over all section variables.
at line 50
void
set(string $name, mixed $value, string|null $expiration = null)
Sets a variable in this session section.
at line 65
mixed
get(string $name)
Gets a variable from this session section.
at line 80
void
remove(string|array|null $name = null)
Removes a variable or whole section.
at line 102
void
__set(string $name, $value)
deprecated
deprecated
Sets a variable in this session section.
at line 113
mixed
__get(string $name)
deprecated
deprecated
Gets a variable from this session section.
at line 125
bool
__isset(string $name)
deprecated
deprecated
Determines whether a variable in this session section is set.
at line 136
void
__unset(string $name)
deprecated
deprecated
Unsets a variable in this session section.
at line 146
void
offsetSet($name, $value)
deprecated
deprecated
Sets a variable in this session section.
at line 156
mixed
offsetGet($name)
deprecated
deprecated
Gets a variable from this session section.
at line 166
bool
offsetExists($name)
deprecated
deprecated
Determines whether a variable in this session section is set.
at line 176
void
offsetUnset($name)
deprecated
deprecated
Unsets a variable in this session section.
at line 186
SessionSection
setExpiration(string|null $time, string|array|null $variables = null)
Sets the expiration of the section or specific variables.
at line 213
void
removeExpiration(string|array|null $variables = null)
Removes the expiration from the section or specific variables.
Traits
Strict class for better experience.