Documentation

EncryptCookies extends 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>
Shift gracefully to unserialized cookies
decryptCookie()  : string|array<string|int, mixed>
Shift gracefully to unserialized cookies
duplicate()  : Cookie
Duplicate a cookie with a new value.
encrypt()  : Response
Encrypt the cookies on an outgoing response.

Properties

$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

decryptArray()

Shift gracefully to unserialized cookies

protected decryptArray(array<string|int, mixed> $cookie) : array<string|int, mixed>
Parameters
$cookie : array<string|int, mixed>
Tags
todo

Remove entire method if year >= 2021 or build >= 475

Return values
array<string|int, mixed>

decryptCookie()

Shift gracefully to unserialized cookies

protected decryptCookie(mixed $name, mixed $cookie) : string|array<string|int, mixed>
Parameters
$name : mixed
$cookie : mixed
Tags
todo

Remove entire method if year >= 2021 or build >= 475

Return values
string|array<string|int, mixed>

Search results