class SessionValidator implements SessionValidatorInterface, LoggerAwareInterface (View source)

Class SessionValidator Base concrete5 session validator, validates the IP and the agent across requests.

\@package Concrete\Core\Session

Traits

Trait LoggerAwareTrait A trait used with LoggerAwareInterface

LoggerAwareTrait

Constants

CONFIGKEY_IP_MISMATCH

CONFIGKEY_IP_MISMATCH_ALLOWLIST

CONFIGKEY_ENABLE_USERSPECIFIC_IP_MISMATCH_ALLOWLIST

CONFIGKEY_USERAGENT_MISMATCH

CONFIGKEY_SESSION_INVALIDATE

CONFIGKEY_INVALIDATE_INACTIVE_USERS

CONFIGKEY_INVALIDATE_INACTIVE_USERS_TIME

Properties

private Application $app
private Repository $config
private Request $request

Methods

getLoggerChannel()

No description

__construct(Application $app, Repository $config, Request $request, LoggerInterface $logger = null)

No description

handleSessionValidation(Session $session)

No description

bool
shouldValidateUserActivity(Session $session)

No description

int
getUserActivityThreshold()

No description

bool
hasActiveSession()

Check if there is an active session.

Session|null
getActiveSession(bool $start = false)

Get the current session (if it exists).

bool
shouldCompareIP()

No description

bool
considerIPChanged(AddressInterface $currentIP, AddressInterface|null $previousIP)

No description

bool
shouldCompareAgent()

No description

setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

Details

getLoggerChannel()

__construct(Application $app, Repository $config, Request $request, LoggerInterface $logger = null)

No description

Parameters

Application $app
Repository $config
Request $request
LoggerInterface $logger

handleSessionValidation(Session $session)

No description

Parameters

Session $session

bool shouldValidateUserActivity(Session $session)

No description

Parameters

Session $session

Return Value

bool

int getUserActivityThreshold()

No description

Return Value

int

bool hasActiveSession()

Check if there is an active session.

Return Value

bool

Session|null getActiveSession(bool $start = false)

Get the current session (if it exists).

Parameters

bool $start

set to true to initialize the current session if it's not already started

Return Value

Session|null

Returns NULL if $start is falsy and the session is not already started

private bool shouldCompareIP()

No description

Return Value

bool

private bool considerIPChanged(AddressInterface $currentIP, AddressInterface|null $previousIP)

No description

Parameters

AddressInterface $currentIP
AddressInterface|null $previousIP

Return Value

bool

private bool shouldCompareAgent()

No description

Return Value

bool

setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

Parameters

LoggerInterface $logger