SessionManager
in package
FinalYes
Tags
Table of Contents
Constants
- CSRF : mixed = 'csrf'
- CSRF_N_BYTES : mixed = 32
- CURRENT_USERNAME_KEY : mixed = "cmu"
- CUSTOM_PREFIX : mixed = 'custom_'
- MESSAGES : mixed = 'messages'
Properties
- $data : array<string|int, mixed>
Methods
- __construct() : mixed
- addMessage() : void
- getAndDeleteMessages() : array<int, string>
- getCsrf() : string
- getCurrentUsername() : string|null
- getCustom() : string
- isUserLoggedIn() : bool
- setCurrentUsername() : void
- setCustom() : void
Constants
CSRF
public
mixed
CSRF
= 'csrf'
CSRF_N_BYTES
public
mixed
CSRF_N_BYTES
= 32
CURRENT_USERNAME_KEY
public
mixed
CURRENT_USERNAME_KEY
= "cmu"
CUSTOM_PREFIX
public
mixed
CUSTOM_PREFIX
= 'custom_'
MESSAGES
public
mixed
MESSAGES
= 'messages'
Properties
$data
private
array<string|int, mixed>
$data
Methods
__construct()
public
__construct([null|array<string, scalar> $data = null ]) : mixed
Parameters
- $data : null|array<string, scalar> = null
Tags
addMessage()
public
addMessage(string $msg) : void
Parameters
- $msg : string
getAndDeleteMessages()
public
getAndDeleteMessages() : array<int, string>
Return values
array<int, string>getCsrf()
public
getCsrf() : string
Return values
stringgetCurrentUsername()
public
getCurrentUsername() : string|null
Return values
string|nullgetCustom()
public
getCustom(string $key) : string
Parameters
- $key : string
Return values
stringisUserLoggedIn()
public
isUserLoggedIn() : bool
Return values
boolsetCurrentUsername()
public
setCurrentUsername(string|null $username) : void
Parameters
- $username : string|null
Tags
setCustom()
public
setCustom(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed