Session
interface Session
Methods
Get the name of the session.
Set the name of the session.
Get the current session ID.
Set the session ID.
Start the session, reading the data from a handler.
Save the session data to storage.
Get all of the session data.
Checks if a key exists.
Checks if a key is present and not null.
Get an item from the session.
Get the value of a given key and then forget it.
Put a key / value pair or array of key / value pairs in the session.
Replace the given session attributes entirely.
Flash a key / value pair to the session.
Flash an array of input to the session.
Reflash all of the session flash data.
Get a subset of the session data.
Determine if the flashed input contains an item.
Get the requested item from the flashed input array.
Get the CSRF token value.
Regenerate the CSRF token value.
Remove an item from the session, returning its value.
Remove one or many items from the session.
Remove all of the items from the session.
Flush the session data and regenerate the ID.
Generate a new session identifier.
Generate a new session ID for the session.
Determine if the session has been started.
Get the previous URL from the session.
Set the "previous" URL in the session.
Specify that the user has confirmed their password.
Get the session handler instance.
Determine if the session handler needs a request.
Details
at line 16
string
getName()
Get the name of the session.
at line 21
void
setName(string $name)
Set the name of the session.
at line 26
string
getId()
Get the current session ID.
at line 31
void
setId(string|null $id)
Set the session ID.
at line 36
bool
start()
Start the session, reading the data from a handler.
at line 41
void
save()
Save the session data to storage.
at line 46
array
all()
Get all of the session data.
at line 51
bool
exists(array|UnitEnum|string $key)
Checks if a key exists.
at line 56
bool
has(array|UnitEnum|string $key)
Checks if a key is present and not null.
at line 61
mixed
get(UnitEnum|string $key, mixed $default = null)
Get an item from the session.
at line 66
mixed
pull(UnitEnum|string $key, mixed $default = null)
Get the value of a given key and then forget it.
at line 71
void
put(array|UnitEnum|string $key, mixed $value = null)
Put a key / value pair or array of key / value pairs in the session.
at line 76
void
replace(array $attributes)
Replace the given session attributes entirely.
at line 81
void
flash(UnitEnum|string $key, mixed $value = true)
Flash a key / value pair to the session.
at line 86
void
flashInput(array $value)
Flash an array of input to the session.
at line 91
void
reflash()
Reflash all of the session flash data.
at line 96
array
only(array $keys)
Get a subset of the session data.
at line 101
bool
hasOldInput(UnitEnum|string|null $key = null)
Determine if the flashed input contains an item.
at line 106
mixed
getOldInput(UnitEnum|string|null $key = null, mixed $default = null)
Get the requested item from the flashed input array.
at line 111
string|null
token()
Get the CSRF token value.
at line 116
void
regenerateToken()
Regenerate the CSRF token value.
at line 121
mixed
remove(UnitEnum|string $key)
Remove an item from the session, returning its value.
at line 126
void
forget(array|UnitEnum|string $keys)
Remove one or many items from the session.
at line 131
void
flush()
Remove all of the items from the session.
at line 136
bool
invalidate()
Flush the session data and regenerate the ID.
at line 141
bool
regenerate(bool $destroy = false)
Generate a new session identifier.
at line 146
bool
migrate(bool $destroy = false)
Generate a new session ID for the session.
at line 151
bool
isStarted()
Determine if the session has been started.
at line 156
string|null
previousUrl()
Get the previous URL from the session.
at line 161
void
setPreviousUrl(string $url)
Set the "previous" URL in the session.
at line 166
void
passwordConfirmed(string|null $guard = null)
Specify that the user has confirmed their password.
at line 171
SessionHandlerInterface
getHandler()
Get the session handler instance.
at line 176
bool
handlerNeedsRequest()
Determine if the session handler needs a request.
at line 181
void
setRequestOnHandler(Request $request)
Set the request on the handler instance.