class Session

Class Session

Methods

__construct(bool $db = false)

Session constructor.

mixed
clean_session()

Sets is_dirty flag to 0

clear($key)

Clear the passed Session key

close()

Call session_write_close function

destroy()

Destroys the current session and starts a fresh session

bool|mixed|string
get($key)

Get the value for the passed key. The value can be stored using set() and is available until the user session is destroyed

array
get_current_sessions()

Returns a List of User IDs having a Session

array
get_session_handler_info()

Returns information about the current session handler

string
get_session_id()

Returns the current, cleaned Session ID

bool
is_dirty()

Returns true if the current session is marked as dirty

logout_user($user_ids)

Logout specific users(Destroys a specific Session)

pollute_session(bool|array $user_ids = false, $invalidate_policy_clusters = true)

sets is_dirty flag for session(s) of given user_id (or array of ids) if user id is false, current user id is used

pollute_session_for_groups(array $groups = array(), int $group_security_id = 0, $invalidate_policy_clusters = true)

Sets is_dirty flag for all sessions assigned to users within $groups

bool
session_valid_id($session_id)

Validate session id

set(string $key, mixed $value)

Set and save a key-value in the current users session. This value is stored until the session is destroyed (end of user session)

set_lifetime(int $life_time)

Modify the session lifetime for the current session if possible It is currently NOT possible to set lifetime for REDIS Session Handler with this method as REDIS requires setting the

start($use_fallback_handler = false)

Register as session handler and start session Session can only be started ONCE per request

Details

at line 63
__construct(bool $db = false)

Session constructor.

Parameters

bool $db

at line 480
mixed clean_session()

Sets is_dirty flag to 0

Return Value

mixed

at line 361
clear($key)

Clear the passed Session key

Parameters

$key

at line 74
close()

Call session_write_close function

at line 369
destroy()

Destroys the current session and starts a fresh session

at line 296
bool|mixed|string get($key)

Get the value for the passed key. The value can be stored using set() and is available until the user session is destroyed

Parameters

$key

Return Value

bool|mixed|string

at line 526
array get_current_sessions()

Returns a List of User IDs having a Session

Return Value

array

1-Dim Array with User-IDs [1,2,3]

at line 391
array get_session_handler_info()

Returns information about the current session handler

Return Value

array

['class'=>CLASS_OF_HANDLER]

at line 250
string get_session_id()

Returns the current, cleaned Session ID

Return Value

string

at line 262
bool is_dirty()

Returns true if the current session is marked as dirty

Return Value

bool

at line 538
logout_user($user_ids)

Logout specific users(Destroys a specific Session)

Parameters

$user_ids

at line 408
pollute_session(bool|array $user_ids = false, $invalidate_policy_clusters = true)

sets is_dirty flag for session(s) of given user_id (or array of ids) if user id is false, current user id is used

Parameters

bool|array $user_ids
$invalidate_policy_clusters

at line 444
pollute_session_for_groups(array $groups = array(), int $group_security_id = 0, $invalidate_policy_clusters = true)

Sets is_dirty flag for all sessions assigned to users within $groups

Parameters

array $groups
int $group_security_id
$invalidate_policy_clusters

at line 382
bool session_valid_id($session_id)

Validate session id

Parameters

$session_id

Return Value

bool

at line 326
set(string $key, mixed $value)

Set and save a key-value in the current users session. This value is stored until the session is destroyed (end of user session)

Parameters

string $key
mixed $value

at line 282
set_lifetime(int $life_time)

Modify the session lifetime for the current session if possible It is currently NOT possible to set lifetime for REDIS Session Handler with this method as REDIS requires setting the

Parameters

int $life_time

at line 85
start($use_fallback_handler = false)

Register as session handler and start session Session can only be started ONCE per request

Parameters

$use_fallback_handler

Exceptions

LogicException

when session is started twice

RuntimeException

for unexpected problems (e.g. session server not available)