jemer / session
Session manager for php projects
v1.0.0
2024-12-06 23:48 UTC
README
Session manager for Php projects.
Useage
composer require jemer/session
Start a new session by calling the SessionManager::Instance()->Start
method. Pass in any session properties that you would want.
use Jemer\Session\SessionManager; SessionManager::Instance()->Start([ "username" => "Bob", "role" => "manager", "yearsOfService" => 15 ]);
To get a property from the session manager just call its Get()
and pass in the name of the key. In this case were looking for the "username"
echo SessionManager::Instance()->Get("username"); returns: Bob
To end the session just call the SessionManager::Instance()->End()
. This will end the session and remove all values from the $_SESSION
array.