\cge_session

A simple class for storing, and retrieving data from the session.

Sample Usage:
$sess = new cge_session(FILE);
$sess->put('foo','bar');
$foo = $sess->get('foo');

Summary

Methods
Properties
Constants
__construct()
clear()
set()
put()
exists()
get()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string $keyname)

Constructor.

Parameters

string $keyname

An optional primary key for the session data. The key is useful for preventing conflicts in session data stored by different modules or actions.

clear()

clear(string $key)

Clear or erase a session variable.

Parameters

string $key

The session variable to erase. If no data is specified, all data associated with the primary key will be erased.

set()

set(string $key, mixed $value)

Set a session variable.

This is an alias for the put method.

Parameters

string $key
mixed $value

put()

put(string $key, mixed $value)

Set a session variable.

This is an alias for the put method.

Parameters

string $key
mixed $value

exists()

exists(string $key) : bool

Test if a session variable exists.

Parameters

string $key

Returns

bool

get()

get(string $key, mixed $dfltvalue) : mixed

Retrieve a session variable.

Parameters

string $key
mixed $dfltvalue

The default value to return if the data cannot be found in the session.

Returns

mixed