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

Properties

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

Methods

getLoggerChannel()

No description

__construct(Application $app, Repository $config, Request $request, IPService $ipService, 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
shouldCompareAgent()

No description

setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

Details

getLoggerChannel()

See also

\Concrete\Core\Logging\LoggerAwareInterface::getLoggerChannel()

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

Parameters

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

handleSessionValidation(Session $session)

Parameters

Session $session

bool shouldValidateUserActivity(Session $session)

Parameters

Session $session

Return Value

bool

int getUserActivityThreshold()

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()

Return Value

bool

private bool shouldCompareAgent()

Return Value

bool

setLogger(LoggerInterface $logger)

Sets a logger instance on the object.

Parameters

LoggerInterface $logger