EncryptCookies
class EncryptCookies (View source)
Properties
protected Encrypter | $encrypter | The encrypter instance. |
|
protected array<int,string> | $except | The names of the cookies that should not be encrypted. |
|
static protected array | $neverEncrypt | The globally ignored cookies that should not be encrypted. |
|
static protected bool | $serialize | Indicates if cookies should be serialized. |
Methods
Disable encryption for the given cookie name(s).
Decrypt the cookies on the request.
Validate and remove the cookie value prefix from the value.
Validate and remove the cookie value prefix from all values of an array.
Decrypt the given cookie and return the value.
Decrypt an array based cookie.
Encrypt the cookies on an outgoing response.
Duplicate a cookie with a new value.
Determine whether encryption has been disabled for the given cookie.
Indicate that the given cookies should never be encrypted.
Determine if the cookie contents should be serialized.
Flush the middleware's global state.
Details
void
__construct(Encrypter $encrypter)
Create a new CookieGuard instance.
void
disableFor(string|array $name)
Disable encryption for the given cookie name(s).
protected Request
decrypt(Request $request)
Decrypt the cookies on the request.
protected string|array|null
validateValue(string $key, string $value)
Validate and remove the cookie value prefix from the value.
protected array
validateArray(string $key, array $value)
Validate and remove the cookie value prefix from all values of an array.
protected string|array
decryptCookie(string $name, string|array $cookie)
Decrypt the given cookie and return the value.
protected array
decryptArray(array $cookie)
Decrypt an array based cookie.
protected Response
encrypt(Response $response)
Encrypt the cookies on an outgoing response.
protected Cookie
duplicate(Cookie $cookie, mixed $value)
Duplicate a cookie with a new value.
bool
isDisabled(string $name)
Determine whether encryption has been disabled for the given cookie.
static void
except(array|string $cookies)
Indicate that the given cookies should never be encrypted.
static bool
serialized(string $name)
Determine if the cookie contents should be serialized.
static void
flushState()
Flush the middleware's global state.