Session - notihnio/mgr GitHub Wiki

The MGR introduces the session handler from version 1.2. The session handler is based on session namespaces logic.

To init a session a namespace should be provided on session constructor

example $session = new \Mgr\Session\Session("admin");

where admin is the name of session namespace.

Methods:

getSessionNamespace(void) : returns the session namespace

set(key, value) : sets a key-value pair to session

get(key) : returns the given key value from session

regenerateId(void) : regenerates the session id

destroy(void) : destroys session

Examples:

$session->set("hasIdentity", true);

$session->get("hasIdentity");