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