Documentation

SessionManager
in package

FinalYes
Tags
todo

Should be moved to Http? Would make it easier to Http to access the session, but Session does not need to access Http. Besides, Form only relies on Session but does not rely on Http.

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

Properties

Methods

__construct()

public __construct([null|array<string, scalar> $data = null ]) : mixed
Parameters
$data : null|array<string, scalar> = null
Tags
todo

Magic string.

addMessage()

public addMessage(string $msg) : void
Parameters
$msg : string

getAndDeleteMessages()

public getAndDeleteMessages() : array<int, string>
Return values
array<int, string>

getCurrentUsername()

public getCurrentUsername() : string|null
Return values
string|null

getCustom()

public getCustom(string $key) : string
Parameters
$key : string
Return values
string

isUserLoggedIn()

public isUserLoggedIn() : bool
Return values
bool

setCurrentUsername()

public setCurrentUsername(string|null $username) : void
Parameters
$username : string|null
Tags
todo

Should not accept null.

setCustom()

public setCustom(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
On this page

Search results