class EncryptCookies

Properties

protected Encrypter $encrypter

The encrypter instance.

protected array $except

The names of the cookies that should not be encrypted.

Methods

void
__construct(Encrypter $encrypter)

Create a new CookieGuard instance.

void
disableFor(string|array $cookieName)

Disable encryption for the given cookie name(s).

mixed
handle(Request $request, Closure $next)

Handle an incoming request.

Request
decrypt(Request $request)

Decrypt the cookies on the request.

string|array
decryptCookie(string|array $cookie)

Decrypt the given cookie and return the value.

array
decryptArray(array $cookie)

Decrypt an array based cookie.

Response
encrypt(Response $response)

Encrypt the cookies on an outgoing response.

Cookie
duplicate(Cookie $c, mixed $value)

Duplicate a cookie with a new value.

bool
isDisabled(string $name)

Determine whether encryption has been disabled for the given cookie.

Details

at line 34
void __construct(Encrypter $encrypter)

Create a new CookieGuard instance.

Parameters

Encrypter $encrypter

Return Value

void

at line 45
void disableFor(string|array $cookieName)

Disable encryption for the given cookie name(s).

Parameters

string|array $cookieName

Return Value

void

at line 57
mixed handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

mixed

at line 68
protected Request decrypt(Request $request)

Decrypt the cookies on the request.

Parameters

Request $request

Return Value

Request

at line 91
protected string|array decryptCookie(string|array $cookie)

Decrypt the given cookie and return the value.

Parameters

string|array $cookie

Return Value

string|array

at line 104
protected array decryptArray(array $cookie)

Decrypt an array based cookie.

Parameters

array $cookie

Return Value

array

at line 123
protected Response encrypt(Response $response)

Encrypt the cookies on an outgoing response.

Parameters

Response $response

Return Value

Response

at line 145
protected Cookie duplicate(Cookie $c, mixed $value)

Duplicate a cookie with a new value.

Parameters

Cookie $c
mixed $value

Return Value

Cookie

at line 159
bool isDisabled(string $name)

Determine whether encryption has been disabled for the given cookie.

Parameters

string $name

Return Value

bool