This class can manage PHP session`s assigned with a name. It can take assign the name of the current session to a given name. The class also provides functions to provide features of interest like:
This is a simple framework element, allowing for quick session operations in php. One-line defining of a global variable.
Instead of checking whether it exists in one line, we receive those two things.
In this case, we download
$_SESSION['ok'] and if it doesn't exist right away, we define it with the second parameter
false. You can put any value in place of
$this->baseClass->session is found in the app/bootstrap.php file, as
$this->session = new \Dframe\Session('name');. Parameter is relayed to the object and defines the session name.
Simplicity and minimalism make you want to use the same class. In order to achieve that, the following methods are available in the project.
Edit page (Session/overview)
$this->session = new \Dframe\Session('name'); $session = new Session('HashSaltRandomForSession'); $session->register(); // Set session_id and session_time - default 60 $session->authLogin(); // Return true/false if session is registrer $session->set($key, $value); // set $_SESSION[$key] = $value; $session->get($key, $or = null); // get $_SESSION[$key]; $session->remove($key) // unset($_SESSION[$key]); $session->end(); // session_destroy