class MfaSessionManager (View source)

Sets, reads and resets the MFA pending/verified state in the session.

Methods

__construct(SessionInterface $session, LoggerInterface|null $logger = null)

No description

void
setMfaRequired(int $userId)

Flags a user as requiring MFA verification

void
setMfaVerified()

Marks MFA as completed and sets the user as fully authenticated

bool
isMfaRequired()

Check if MFA is required for the current user

MfaSessionState
currentState()

The session's verification state.

void
setMfaNotRequired()

Record that no second factor applies, so the four slots cannot disagree.

void
reset()

Reset all MFA-related session variables

Details

__construct(SessionInterface $session, LoggerInterface|null $logger = null)

No description

Parameters

SessionInterface $session
LoggerInterface|null $logger

void setMfaRequired(int $userId)

Flags a user as requiring MFA verification

Parameters

int $userId

The user ID

Return Value

void

void setMfaVerified()

Marks MFA as completed and sets the user as fully authenticated

Return Value

void

bool isMfaRequired()

Check if MFA is required for the current user

Return Value

bool

MfaSessionState currentState()

The session's verification state.

Sessions established before MFA_STATE existed are classified from the legacy slots, which is why that reconciliation is still here. Its "absent means not required" default is load-bearing: users who have no second factor never get any of these keys set.

Return Value

MfaSessionState

void setMfaNotRequired()

Record that no second factor applies, so the four slots cannot disagree.

Return Value

void

void reset()

Reset all MFA-related session variables

Return Value

void