class Session (View source)

Methods

void
__construct(string $name = 'inphinit', string|null $id = null, array $opts = array())

Create cookie session and configure session

void
commit(bool $unlock = true)

Lock session file and save variables

void
regenerate($id = null, $deleteold = false)

Regenerate ID

mixed
get(string $path = null, string $alternative = null)

Get all values like array or get specific item by level (multidimensional) using path

void
__clone()

Prevent clone session object

mixed
__get(string $name)

Magic method for get session variables (this method also returns variables that have not yet been committed)

void
__set(string $name, mixed $value)

Magic method for set session variables (this method don't commit data)

bool
__isset(string $name)

Magic method for check if variable is setted (this method also returns variables that have not yet been committed)

void
__unset(string $name)

Magic method for unset variable with unset() function

Details

void __construct(string $name = 'inphinit', string|null $id = null, array $opts = array())

Create cookie session and configure session

Parameters

string $name
string|null $id
array $opts

Return Value

void

Exceptions

Exception

void commit(bool $unlock = true)

Lock session file and save variables

Parameters

bool $unlock

Return Value

void

void regenerate($id = null, $deleteold = false)

Regenerate ID

Parameters

$id
$deleteold

Return Value

void

Exceptions

Exception

mixed get(string $path = null, string $alternative = null)

Get all values like array or get specific item by level (multidimensional) using path

Parameters

string $path (optional) Path with "dots"
string $alternative (optional) alternative value does not find the selected value, default is null

Return Value

mixed

void __clone()

Prevent clone session object

Return Value

void

Exceptions

Exception

mixed __get(string $name)

Magic method for get session variables (this method also returns variables that have not yet been committed)

Parameters

string $name

Return Value

mixed

void __set(string $name, mixed $value)

Magic method for set session variables (this method don't commit data)

Parameters

string $name
mixed $value

Return Value

void

Exceptions

Exception

bool __isset(string $name)

Magic method for check if variable is setted (this method also returns variables that have not yet been committed)

Parameters

string $name

Return Value

bool

void __unset(string $name)

Magic method for unset variable with unset() function

Parameters

string $name

Return Value

void