joebengalen / session
Lightweight session manager library.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 2
pkg:composer/joebengalen/session
Requires
- php: >=5.4
- joebengalen/config: ~1.0
This package is not auto-updated.
Last update: 2025-12-21 00:38:28 UTC
README
Lightweight session manager library.
Uses PHP's $_SESSION global with a namespace so no interference should happen with other libraries.
Session object should have set, get, has, remove and clear methods and implement \ArrayAccess. This is done by extending the JoeBengalen\Config\AbstractConfig class. Doing so we also get support for arrays with dot notation.
<?php $session = new \JoeBengalen\Session\Session('unique_namespace'); $session['key1.key2'] = 'value1'; $session['key1.key3'] = 'value2'; var_dump($session->get('key1')); // -> returns ['key2' => 'value1', 'key3' => 'value2'] var_dump($session->get()); // -> returns all session data var_dump($session->get() === $_SESSION[$session->getNamespace()]); // -> returns true