CsrfTokenManagerAdapter deprecated
class CsrfTokenManagerAdapter implements CsrfProviderInterface
deprecated
Adapter for using the new token generator with the old interface.
Methods
__construct(CsrfTokenManagerInterface $tokenManager) | ||
getTokenManager($triggerDeprecationError = true) | ||
string | generateCsrfToken(string $intention) Generates a CSRF token for a page of your application. | |
bool | isCsrfTokenValid(string $intention, string $token) Validates a CSRF token. |
Details
__construct(CsrfTokenManagerInterface $tokenManager)
Parameters
CsrfTokenManagerInterface | $tokenManager |
getTokenManager($triggerDeprecationError = true)
Parameters
$triggerDeprecationError |
string generateCsrfToken(string $intention)
Generates a CSRF token for a page of your application.
Parameters
string | $intention | Some value that identifies the action intention (i.e. "authenticate"). Doesn't have to be a secret value. |
Return Value
string | The generated token |
bool isCsrfTokenValid(string $intention, string $token)
Validates a CSRF token.
Parameters
string | $intention | The intention used when generating the CSRF token |
string | $token | The token supplied by the browser |
Return Value
bool | Whether the token supplied by the browser is correct |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.html