class CookieValuePrefix (View source)

Methods

static string
create(string $cookieName, string $key)

Create a new cookie value prefix for the given cookie name.

static string
remove(string $cookieValue)

Remove the cookie value prefix.

static string|null
validate(string $cookieName, string $cookieValue, array $keys)

Validate a cookie value contains a valid prefix. If it does, return the cookie value with the prefix removed. Otherwise, return null.

Details

static string create(string $cookieName, string $key)

Create a new cookie value prefix for the given cookie name.

Parameters

string $cookieName
string $key

Return Value

string

static string remove(string $cookieValue)

Remove the cookie value prefix.

Parameters

string $cookieValue

Return Value

string

static string|null validate(string $cookieName, string $cookieValue, array $keys)

Validate a cookie value contains a valid prefix. If it does, return the cookie value with the prefix removed. Otherwise, return null.

Parameters

string $cookieName
string $cookieValue
array $keys

Return Value

string|null