class Session

Methods

__construct()

The constructor

string
getId()

Get the current session id

void
newId(bool $bDeleteData = false)

Generate a new session id

void
start()

Start the session

void
set(string $sKey, string $xValue)

Save data in the session

bool
has(string $sKey)

Check if a session key exists

mixed|$xDefault
get(string $sKey, string $xDefault = null)

Get data from the session

array
all()

Get all data in the session

void
delete(string $sKey)

Delete a session key and its data

void
clear()

Delete all data in the session

void
destroy()

Delete all data in the session

Details

at line line 28
__construct()

The constructor

at line line 40
string getId()

Get the current session id

Return Value

string The session id

at line line 52
void newId(bool $bDeleteData = false)

Generate a new session id

Parameters

bool $bDeleteData Whether to delete data from the previous session

Return Value

void

at line line 66
void start()

Start the session

Return Value

void

at line line 79
void set(string $sKey, string $xValue)

Save data in the session

Parameters

string $sKey The session key
string $xValue The session value

Return Value

void

at line line 91
bool has(string $sKey)

Check if a session key exists

Parameters

string $sKey The session key

Return Value

bool True if the session key exists, else false

at line line 104
mixed|$xDefault get(string $sKey, string $xDefault = null)

Get data from the session

Parameters

string $sKey The session key
string $xDefault The default value

Return Value

mixed|$xDefault The data under the session key, or the $xDefault parameter

at line line 114
array all()

Get all data in the session

Return Value

array An array of all data in the session

at line line 126
void delete(string $sKey)

Delete a session key and its data

Parameters

string $sKey The session key

Return Value

void

at line line 139
void clear()

Delete all data in the session

Return Value

void

at line line 149
void destroy()

Delete all data in the session

Return Value

void