Store
Implements
Properties
$id string
The session ID.
$name string
The session name.
$attributes array
The session attributes.
$started bool
Session store started status.
Methods
__construct ( $name , SessionHandlerInterface $handler , $id ) : void
Create a new session instance.
Parameters
- $name string
- $handler SessionHandlerInterface
- $id string|null
start ( ) : bool
Start the session, reading the data from a handler.
loadSession ( ) : void
Load the session data from the handler.
readFromHandler ( ) : array
Read the session data from the handler.
prepareForUnserialize ( $data ) : string
Prepare the raw string data from the session for unserialization.
Parameters
- $data string
save ( ) : void
Save the session data to storage.
prepareForStorage ( $data ) : string
Prepare the serialized session data for storage.
Parameters
- $data string
ageFlashData ( ) : void
Age the flash data for the session.
all ( ) : array
Get all of the session data.
only ( array $keys ) : array
Get a subset of the session data.
Parameters
- $keys array
exists ( $key ) : bool
Checks if a key exists.
Parameters
- $key string|array
missing ( $key ) : bool
Determine if the given key is missing from the session data.
Parameters
- $key string|array
has ( $key ) : bool
Checks if a key is present and not null.
Parameters
- $key string|array
get ( $key , $default ) : mixed
Get an item from the session.
Parameters
- $key string
- $default mixed
pull ( $key , $default ) : mixed
Get the value of a given key and then forget it.
Parameters
- $key string
- $default mixed
hasOldInput ( $key ) : bool
Determine if the session contains old input.
Parameters
- $key string|null
getOldInput ( $key , $default ) : mixed
Get the requested item from the flashed input array.
Parameters
- $key string|null
- $default mixed
replace ( array $attributes ) : void
Replace the given session attributes entirely.
Parameters
- $attributes array
put ( $key , $value ) : void
Put a key / value pair or array of key / value pairs in the session.
Parameters
- $key string|array
- $value mixed
remember ( $key , Closure $callback ) : mixed
Get an item from the session, or store the default value.
Parameters
- $key string
- $callback Closure
push ( $key , $value ) : void
Push a value onto a session array.
Parameters
- $key string
- $value mixed
increment ( $key , $amount ) : mixed
Increment the value of an item in the session.
Parameters
- $key string
- $amount int
decrement ( $key , $amount ) : int
Decrement the value of an item in the session.
Parameters
- $key string
- $amount int
flash ( string $key , $value ) : void
Flash a key / value pair to the session.
Parameters
- $key string
- $value mixed
now ( $key , $value ) : void
Flash a key / value pair to the session for immediate use.
Parameters
- $key string
- $value mixed
reflash ( ) : void
Reflash all of the session flash data.
keep ( $keys ) : void
Reflash a subset of the current flash data.
Parameters
- $keys array|mixed
mergeNewFlashes ( array $keys ) : void
Merge new flash keys into the new flash array.
Parameters
- $keys array
removeFromOldFlashData ( array $keys ) : void
Remove the given keys from the old flash data.
Parameters
- $keys array
flashInput ( array $value ) : void
Flash an input array to the session.
Parameters
- $value array
remove ( $key ) : mixed
Remove an item from the session, returning its value.
Parameters
- $key string
forget ( $keys ) : void
Remove one or many items from the session.
Parameters
- $keys string|array
flush ( ) : void
Remove all of the items from the session.
invalidate ( ) : bool
Flush the session data and regenerate the ID.
regenerate ( $destroy ) : bool
Generate a new session identifier.
Parameters
- $destroy bool
migrate ( $destroy ) : bool
Generate a new session ID for the session.
Parameters
- $destroy bool
isStarted ( ) : bool
Determine if the session has been started.
getName ( ) : string
Get the name of the session.
setName ( $name ) : void
Set the name of the session.
Parameters
- $name string
getId ( ) : string
Get the current session ID.
setId ( $id ) : void
Set the session ID.
Parameters
- $id string
isValidId ( $id ) : bool
Determine if this is a valid session ID.
Parameters
- $id string
generateSessionId ( ) : string
Get a new, random session ID.
setExists ( $value ) : void
Set the existence of the session on the handler if applicable.
Parameters
- $value bool
token ( ) : string
Get the CSRF token value.
regenerateToken ( ) : void
Regenerate the CSRF token value.
previousUrl ( ) : string|null
Get the previous URL from the session.
setPreviousUrl ( $url ) : void
Set the "previous" URL in the session.
Parameters
- $url string
passwordConfirmed ( ) : void
Specify that the user has confirmed their password.
handlerNeedsRequest ( ) : bool
Determine if the session handler needs a request.
setRequestOnHandler ( $request ) : void
Set the request on the handler instance.
Parameters
- $request Request