EncryptedStore
class EncryptedStore extends Store (View source)
Properties
protected string | $id | The session ID. |
from Store |
protected string | $name | The session name. |
from Store |
protected array | $attributes | The session attributes. |
from Store |
protected SessionHandlerInterface | $handler | The session handler implementation. |
from Store |
protected bool | $started | Session store started status. |
from Store |
protected Encrypter | $encrypter | The encrypter instance. |
Methods
Create a new session instance.
Prepare the raw string data from the session for unserialization.
Prepare the serialized session data for storage.
Get the value of a given key and then forget it.
Get the requested item from the flashed input array.
Put a key / value pair or array of key / value pairs in the session.
Increment the value of an item in the session.
Decrement the value of an item in the session.
Flash a key / value pair to the session for immediate use.
Set the existence of the session on the handler if applicable.
Get the encrypter instance.
Details
void
__construct(string $name, SessionHandlerInterface $handler, Encrypter $encrypter, string|null $id = null)
Create a new session instance.
in
Store at line 69
bool
start()
Start the session, reading the data from a handler.
in
Store at line 85
protected void
loadSession()
Load the session data from the handler.
in
Store at line 95
protected array
readFromHandler()
Read the session data from the handler.
protected string
prepareForUnserialize(string $data)
Prepare the raw string data from the session for unserialization.
in
Store at line 124
void
save()
Save the session data to storage.
protected string
prepareForStorage(string $data)
Prepare the serialized session data for storage.
in
Store at line 151
void
ageFlashData()
Age the flash data for the session.
in
Store at line 165
array
all()
Get all of the session data.
in
Store at line 176
array
only(array $keys)
Get a subset of the session data.
in
Store at line 187
bool
exists(string|array $key)
Checks if a key exists.
in
Store at line 202
bool
has(string|array $key)
Checks if a key is present and not null.
in
Store at line 216
mixed
get(string $key, mixed $default = null)
Get an item from the session.
in
Store at line 228
mixed
pull(string $key, string|null $default = null)
Get the value of a given key and then forget it.
in
Store at line 239
bool
hasOldInput(string|null $key = null)
Determine if the session contains old input.
in
Store at line 253
mixed
getOldInput(string|null $key = null, mixed $default = null)
Get the requested item from the flashed input array.
in
Store at line 264
void
replace(array $attributes)
Replace the given session attributes entirely.
in
Store at line 276
void
put(string|array $key, mixed $value = null)
Put a key / value pair or array of key / value pairs in the session.
in
Store at line 294
mixed
remember(string $key, Closure $callback)
Get an item from the session, or store the default value.
in
Store at line 312
void
push(string $key, mixed $value)
Push a value onto a session array.
in
Store at line 328
mixed
increment(string $key, int $amount = 1)
Increment the value of an item in the session.
in
Store at line 342
int
decrement(string $key, int $amount = 1)
Decrement the value of an item in the session.
in
Store at line 354
void
flash(string $key, mixed $value = true)
Flash a key / value pair to the session.
in
Store at line 370
void
now(string $key, mixed $value)
Flash a key / value pair to the session for immediate use.
in
Store at line 382
void
reflash()
Reflash all of the session flash data.
in
Store at line 395
void
keep(array|mixed $keys = null)
Reflash a subset of the current flash data.
in
Store at line 408
protected void
mergeNewFlashes(array $keys)
Merge new flash keys into the new flash array.
in
Store at line 421
protected void
removeFromOldFlashData(array $keys)
Remove the given keys from the old flash data.
in
Store at line 432
void
flashInput(array $value)
Flash an input array to the session.
in
Store at line 443
mixed
remove(string $key)
Remove an item from the session, returning its value.
in
Store at line 454
void
forget(string|array $keys)
Remove one or many items from the session.
in
Store at line 464
void
flush()
Remove all of the items from the session.
in
Store at line 474
bool
invalidate()
Flush the session data and regenerate the ID.
in
Store at line 487
bool
regenerate(bool $destroy = false)
Generate a new session identifier.
in
Store at line 500
bool
migrate(bool $destroy = false)
Generate a new session ID for the session.
in
Store at line 518
bool
isStarted()
Determine if the session has been started.
in
Store at line 528
string
getName()
Get the name of the session.
in
Store at line 539
void
setName(string $name)
Set the name of the session.
in
Store at line 549
string
getId()
Get the current session ID.
in
Store at line 560
void
setId(string $id)
Set the session ID.
in
Store at line 571
bool
isValidId(string $id)
Determine if this is a valid session ID.
in
Store at line 581
protected string
generateSessionId()
Get a new, random session ID.
in
Store at line 592
void
setExists(bool $value)
Set the existence of the session on the handler if applicable.
in
Store at line 604
string
token()
Get the CSRF token value.
in
Store at line 614
void
regenerateToken()
Regenerate the CSRF token value.
in
Store at line 624
string|null
previousUrl()
Get the previous URL from the session.
in
Store at line 635
void
setPreviousUrl(string $url)
Set the "previous" URL in the session.
in
Store at line 645
SessionHandlerInterface
getHandler()
Get the underlying session handler implementation.
in
Store at line 655
bool
handlerNeedsRequest()
Determine if the session handler needs a request.
in
Store at line 666
void
setRequestOnHandler(Request $request)
Set the request on the handler instance.
Encrypter
getEncrypter()
Get the encrypter instance.