Final Class Yiisoft\Csrf\MaskedCsrfToken
| Inheritance | Yiisoft\Csrf\MaskedCsrfToken |
|---|---|
| Implements | Yiisoft\Csrf\CsrfTokenInterface |
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 \Yiisoft\Security\TokenMask.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Csrf\MaskedCsrfToken | |
| getValue() | Yiisoft\Csrf\MaskedCsrfToken | |
| validate() | Yiisoft\Csrf\MaskedCsrfToken |
Method Details
| public __construct( Yiisoft\Csrf\CsrfTokenInterface $token ): mixed | ||
| $token | Yiisoft\Csrf\CsrfTokenInterface | |
public function __construct(CsrfTokenInterface $token)
{
$this->token = $token;
}
| public getValue( ): string |
public function getValue(): string
{
return TokenMask::apply(
$this->token->getValue(),
);
}
Signup or Login in order to comment.