EncryptedStore
class EncryptedStore extends Store (View source)
Traits
Constants
| protected SESSION_ID_LENGTH |
The length of session ID strings. |
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| 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 string | $serialization | The session store's serialization strategy. |
from Store |
| protected bool | $started | Session store started status. |
from Store |
| protected Encrypter | $encrypter | The encrypter instance. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new session instance.
Prepare the raw string data from the session for unserialization.
Marshal the ViewErrorBag when using JSON serialization for sessions.
Prepare the ViewErrorBag instance for JSON serialization.
Prepare the serialized session data for storage.
Get all the session data except for a specified array of items.
Determine if the given key is missing from the session data.
Determine if any of the given keys are present and not null.
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.
Get an item from the session, or store the default value.
Push a value onto a session array.
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
static void
macro(string $name, object|callable $macro)
Register a custom macro.
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool
hasMacro(string $name)
Checks if macro is registered.
static void
flushMacros()
Flush the existing macros.
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
__construct(string $name, SessionHandlerInterface $handler, Encrypter $encrypter, string|null $id = null, string $serialization = 'php')
Create a new session instance.
in
Store at line 96
bool
start()
Start the session, reading the data from a handler.
in
Store at line 112
protected void
loadSession()
Load the session data from the handler.
in
Store at line 124
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 157
protected void
marshalErrorBag()
Marshal the ViewErrorBag when using JSON serialization for sessions.
in
Store at line 179
void
save()
Save the session data to storage.
in
Store at line 197
protected void
prepareErrorBagForSerialization()
Prepare the ViewErrorBag instance for JSON serialization.
protected string
prepareForStorage(string $data)
Prepare the serialized session data for storage.
in
Store at line 231
void
ageFlashData()
Age the flash data for the session.
in
Store at line 245
array
all()
Get all of the session data.
in
Store at line 256
array
only(array $keys)
Get a subset of the session data.
in
Store at line 267
array
except(array $keys)
Get all the session data except for a specified array of items.
in
Store at line 278
bool
exists(string|array $key)
Checks if a key exists.
in
Store at line 293
bool
missing(string|array $key)
Determine if the given key is missing from the session data.
in
Store at line 304
bool
has(string|array $key)
Determine if a key is present and not null.
in
Store at line 317
bool
hasAny(string|array $key)
Determine if any of the given keys are present and not null.
in
Store at line 331
mixed
get(string $key, mixed $default = null)
Get an item from the session.
in
Store at line 343
mixed
pull(string $key, mixed $default = null)
Get the value of a given key and then forget it.
in
Store at line 354
bool
hasOldInput(string|null $key = null)
Determine if the session contains old input.
in
Store at line 368
mixed
getOldInput(string|null $key = null, mixed $default = null)
Get the requested item from the flashed input array.
in
Store at line 379
void
replace(array $attributes)
Replace the given session attributes entirely.
in
Store at line 391
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 409
mixed
remember(BackedEnum|UnitEnum|string $key, Closure $callback)
Get an item from the session, or store the default value.
in
Store at line 427
void
push(BackedEnum|UnitEnum|string $key, mixed $value)
Push a value onto a session array.
in
Store at line 443
mixed
increment(BackedEnum|UnitEnum|string $key, int $amount = 1)
Increment the value of an item in the session.
in
Store at line 457
int
decrement(BackedEnum|UnitEnum|string $key, int $amount = 1)
Decrement the value of an item in the session.
in
Store at line 469
void
flash(string $key, mixed $value = true)
Flash a key / value pair to the session.
in
Store at line 485
void
now(string $key, mixed $value)
Flash a key / value pair to the session for immediate use.
in
Store at line 497
void
reflash()
Reflash all of the session flash data.
in
Store at line 510
void
keep(mixed $keys = null)
Reflash a subset of the current flash data.
in
Store at line 523
protected void
mergeNewFlashes(array $keys)
Merge new flash keys into the new flash array.
in
Store at line 536
protected void
removeFromOldFlashData(array $keys)
Remove the given keys from the old flash data.
in
Store at line 547
void
flashInput(array $value)
Flash an input array to the session.
in
Store at line 557
Repository
cache()
Get the session cache instance.
in
Store at line 568
mixed
remove(string $key)
Remove an item from the session, returning its value.
in
Store at line 579
void
forget(string|array $keys)
Remove one or many items from the session.
in
Store at line 589
void
flush()
Remove all of the items from the session.
in
Store at line 599
bool
invalidate()
Flush the session data and regenerate the ID.
in
Store at line 612
bool
regenerate(bool $destroy = false)
Generate a new session identifier.
in
Store at line 625
bool
migrate(bool $destroy = false)
Generate a new session ID for the session.
in
Store at line 643
bool
isStarted()
Determine if the session has been started.
in
Store at line 653
string
getName()
Get the name of the session.
in
Store at line 664
void
setName(string $name)
Set the name of the session.
in
Store at line 674
string
id()
Get the current session ID.
in
Store at line 684
string
getId()
Get the current session ID.
in
Store at line 695
void
setId(string $id)
Set the session ID.
in
Store at line 706
bool
isValidId(string|null $id)
Determine if this is a valid session ID.
in
Store at line 716
protected string
generateSessionId()
Get a new, random session ID.
in
Store at line 727
void
setExists(bool $value)
Set the existence of the session on the handler if applicable.
in
Store at line 739
string
token()
Get the CSRF token value.
in
Store at line 749
void
regenerateToken()
Regenerate the CSRF token value.
in
Store at line 759
bool
hasPreviousUri()
Determine if the previous URI is available.
in
Store at line 771
Uri
previousUri()
Get the previous URL from the session as a URI instance.
in
Store at line 785
string|null
previousUrl()
Get the previous URL from the session.
in
Store at line 796
void
setPreviousUrl(string $url)
Set the "previous" URL in the session.
in
Store at line 806
string|null
previousRoute()
Get the previous route name from the session.
in
Store at line 817
void
setPreviousRoute(string|null $route)
Set the "previous" route name in the session.
in
Store at line 827
void
passwordConfirmed()
Specify that the user has confirmed their password.
in
Store at line 837
SessionHandlerInterface
getHandler()
Get the underlying session handler implementation.
in
Store at line 848
SessionHandlerInterface
setHandler(SessionHandlerInterface $handler)
Set the underlying session handler implementation.
in
Store at line 858
bool
handlerNeedsRequest()
Determine if the session handler needs a request.
in
Store at line 869
void
setRequestOnHandler(Request $request)
Set the request on the handler instance.
Encrypter
getEncrypter()
Get the encrypter instance.