Bitrix API

CookiesCrypter

FinalYes

Class CookiesCrypter Designed to encrypt and decrypt cookies.

Table of Contents

Constants

COOKIE_MAX_SIZE  = 4096
COOKIE_RESERVED_SUFFIX_BYTES  = 3

Methods

__construct()  : mixed
decrypt()  : string
Decrypts cookie if needed.
encrypt()  : iterable<string|int, mixed>|array<string|int, Cookie>
Packs and encrypts cookie.
getCipherKey()  : string
Returns cipher key.
shouldDecrypt()  : bool
Checks if cookie should be decrypted.
shouldEncrypt()  : bool
Checks if cookie should be encrypted.

Constants

public mixed COOKIE_RESERVED_SUFFIX_BYTES = 3

Methods

decrypt()

Decrypts cookie if needed.

public decrypt(string $name, string $value, iterable<string|int, mixed> $cookies) : string
Parameters
$name : string

Cookie name.

$value : string

Encrypted cookie value.

$cookies : iterable<string|int, mixed>

Cookies to decrypt.

Return values
string

getCipherKey()

Returns cipher key.

public getCipherKey() : string
Return values
string

shouldDecrypt()

Checks if cookie should be decrypted.

public shouldDecrypt(string $cookieName, string $cookieValue) : bool
Parameters
$cookieName : string

Cookie name.

$cookieValue : string

Cookie value.

Return values
bool

shouldEncrypt()

Checks if cookie should be encrypted.

public shouldEncrypt(Cookie $cookie) : bool
Parameters
$cookie : Cookie

Cookie to check.

Return values
bool

        
On this page

Search results