Skip to content
LaCodon edited this page Mar 1, 2016 · 1 revision

namespace Famework\Session

This class offers a very simple session handler.

Contents

Relevant public methods

start

Starts the session (session_start()).
Throws Exception_Session_Start on Error

static void start([bool $secure = FALSE])
Parameter Purpose
secure Whether cookie should only be sent over secure connections (HTTPS)

setNamespace

Sets the current session namespace.

void setNamespace(string $namespace)
Parameter Purpose
namespace The Namespace identifier

getNamespace

Gets the current getNamespace.

string getNamespace()
Parameter Purpose
RETURN The current namespace

set

Sets a session parameter within the current namespace. If $name is already set, it will be overridden.

void set(string $name, mixed $value)
Parameter Purpose
name The parameter's identifier
value The value to store

get

Gets a previously stored session parameter from the current namespace.

mixed get(string $name)
Parameter Purpose
name The parameter's identifier

getAll

Gets all session parameters of current namespace as array.

array getAll()

regenerateId

Regenerates the session's id.

void regenerateId([bool $delete_old_session = FALSE])
Parameter Purpose
delete_old_session TRUE if the session with the old id should get deleted.

destroySession

Calls session_destroy().

static void destroySession()
Clone this wiki locally