Skip to content

CsrfTokenMiddleware

Constants

Constant Visibility Type Value
CSRF_SESSION_ATTRIBUTE public 'CSRF_TOKEN'

Properties

current

public static \Codefy\Framework\Http\Middleware\Csrf\CsrfTokenMiddleware $current
  • This property is static.

token

private ?string $token

configContainer

protected \Qubus\Config\ConfigContainer $configContainer

sessionService

protected \Qubus\Http\Session\SessionService $sessionService

Methods

__construct

public __construct(\Qubus\Config\ConfigContainer $configContainer, \Qubus\Http\Session\SessionService $sessionService): mixed

Parameters:

Parameter Type Description
$configContainer \Qubus\Config\ConfigContainer
$sessionService \Qubus\Http\Session\SessionService

getField

public static getField(): string
  • This method is static.

Throws:


getFieldAttr

public getFieldAttr(): string

Throws:


process

public process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$request \Psr\Http\Message\ServerRequestInterface
$handler \Psr\Http\Server\RequestHandlerInterface

Inherited methods

generateToken

protected generateToken(): string

Throws:


prepareToken

protected prepareToken(\Qubus\Http\Session\HttpSession $session): string

Parameters:

Parameter Type Description
$session \Qubus\Http\Session\HttpSession

Throws:


hashEquals

protected hashEquals(string $knownString, string $userString): bool

Parameters:

Parameter Type Description
$knownString string
$userString string

Throws:



Automatically generated on 2025-10-13