Final Class Yiisoft\Csrf\MaskedCsrfToken
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Masked CSRF token applies masking to a token string. It makes BREACH attack impossible so it is safe to use it in HTML to be later passed to the next request either as a hidden form field or via JavaScript async request.
See also \
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| getValue() | Yiisoft\ |
|
| validate() | Yiisoft\ |
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $token | Yiisoft\ |
|
public function __construct(CsrfTokenInterface $token)
{
$this->token = $token;
}
| public string getValue ( ) |
public function getValue(): string
{
return TokenMask::apply(
$this->token->getValue(),
);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.