Documentation

ValidateSession

Use case for validating user sessions.

Checks if the current session is valid and restores user context.

Tags
since
3.0.0

Table of Contents

Constants

SESSION_USER_ID  = 'LWT_USER_ID'
Session key for storing the user ID.

Properties

$repository  : UserRepositoryInterface
User repository.

Methods

__construct()  : mixed
Create a new ValidateSession use case.
execute()  : User|null
Execute the session validation.
destroySession()  : void
Destroy the current session.
findUser()  : User|null
Find a user by ID.

Constants

SESSION_USER_ID

Session key for storing the user ID.

private mixed SESSION_USER_ID = 'LWT_USER_ID'

Properties

Methods

execute()

Execute the session validation.

public execute() : User|null
Return values
User|null

The authenticated user or null if invalid

destroySession()

Destroy the current session.

private destroySession() : void

findUser()

Find a user by ID.

private findUser(int $userId) : User|null
Parameters
$userId : int

User ID

Return values
User|null

        
On this page

Search results