EncryptCookies
in package
Table of Contents
- $encrypter : Encrypter
- The encrypter instance.
- $except : array<string|int, mixed>
- The names of the cookies that should not be encrypted.
- $serialize : bool
- Indicates if the cookies should be serialized.
- __construct() : void
- Create a new CookieGuard instance.
- disableFor() : void
- Disable encryption for the given cookie name(s).
- handle() : mixed
- Handle an incoming request.
- isDisabled() : bool
- Determine whether encryption has been disabled for the given cookie.
- serialized() : bool
- Determine if the cookie contents should be serialized.
- decrypt() : Request
- Decrypt the cookies on the request.
- decryptArray() : array<string|int, mixed>
- Decrypt an array based cookie.
- decryptCookie() : string|array<string|int, mixed>
- Decrypt the given cookie and return the value.
- duplicate() : Cookie
- Duplicate a cookie with a new value.
- encrypt() : Response
- Encrypt the cookies on an outgoing response.
Properties
$encrypter
The encrypter instance.
protected
Encrypter
$encrypter
$except
The names of the cookies that should not be encrypted.
protected
array<string|int, mixed>
$except
= []
$serialize
Indicates if the cookies should be serialized.
protected
static bool
$serialize
= false
Methods
__construct()
Create a new CookieGuard instance.
public
__construct(Encrypter $encrypter) : void
Parameters
- $encrypter : Encrypter
Return values
void —disableFor()
Disable encryption for the given cookie name(s).
public
disableFor(string|array<string|int, mixed> $cookieName) : void
Parameters
- $cookieName : string|array<string|int, mixed>
Return values
void —handle()
Handle an incoming request.
public
handle(Request $request, Closure $next) : mixed
Parameters
- $request : Request
- $next : Closure
Return values
mixed —isDisabled()
Determine whether encryption has been disabled for the given cookie.
public
isDisabled(string $name) : bool
Parameters
- $name : string
Return values
bool —serialized()
Determine if the cookie contents should be serialized.
public
static serialized(string $name) : bool
Parameters
- $name : string
Return values
bool —decrypt()
Decrypt the cookies on the request.
protected
decrypt(Request $request) : Request
Parameters
- $request : Request
Return values
Request —decryptArray()
Decrypt an array based cookie.
protected
decryptArray(array<string|int, mixed> $cookie) : array<string|int, mixed>
Parameters
- $cookie : array<string|int, mixed>
Return values
array<string|int, mixed> —decryptCookie()
Decrypt the given cookie and return the value.
protected
decryptCookie(string $name, string|array<string|int, mixed> $cookie) : string|array<string|int, mixed>
Parameters
- $name : string
- $cookie : string|array<string|int, mixed>
Return values
string|array<string|int, mixed> —duplicate()
Duplicate a cookie with a new value.
protected
duplicate(Cookie $c, mixed $value) : Cookie
Parameters
- $c : Cookie
- $value : mixed
Return values
Cookie —encrypt()
Encrypt the cookies on an outgoing response.
protected
encrypt(Response $response) : Response
Parameters
- $response : Response