CsrfToken Class

Aurora\Web Namespace


Properties

settings

SettingsInterface implementation

protected $settings: \SettingsInterface

session

SessionInterface implementation

protected $session: \SessionInterface

Constructor

__construct

Constructor

Parameters

  • Aurora\Settings\SettingsInterface $settings — SettingsInterface implementation
  • Aurora\Http\Session\SessionInterface $session — SessionInterface implementation

Signature

public function __construct(Aurora\Settings\SettingsInterface $settings, Aurora\Http\Session\SessionInterface $session)

Methods

__construct

Constructor

Parameters

  • Aurora\Settings\SettingsInterface $settings — SettingsInterface implementation
  • Aurora\Http\Session\SessionInterface $session — SessionInterface implementation

Signature

public function __construct(Aurora\Settings\SettingsInterface $settings, Aurora\Http\Session\SessionInterface $session)

mask

Mask the token

Parameters

  • string $token — Token to mask

Return Value

  • string

Signature

public function mask(string $token): string

unmask

Unmask the token

Parameters

  • string $token — Token to unmask

Return Value

  • string

Signature

public function unmask(string $token): string

getToken

Get current token value

Return Value

  • string

Signature

public function getToken(): string

generate

Generate CSRF token

Return Value

  • string

Signature

public function generate(): string

validate

Validate CSRF token

Parameters

  • string $token — CSRF token

Return Value

  • bool

Signature

public function validate(string $token): bool

Go to top