Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phauthentic/session
A php session library
https://github.com/phauthentic/session
agnostic agnostic-to-frameworks dependency-free oop php-session session session-management
Last synced: 11 days ago
JSON representation
A php session library
- Host: GitHub
- URL: https://github.com/phauthentic/session
- Owner: Phauthentic
- License: mit
- Created: 2019-03-22T09:36:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-24T15:52:02.000Z (almost 4 years ago)
- Last Synced: 2023-03-03T14:22:20.133Z (over 1 year ago)
- Topics: agnostic, agnostic-to-frameworks, dependency-free, oop, php-session, session, session-management
- Language: PHP
- Size: 67.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Agnostic php session library
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/Phauthentic/session/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Phauthentic/session/)
[![Code Quality](https://img.shields.io/scrutinizer/g/Phauthentic/session/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Phauthentic/session/)A framework agnostic session library with convenient dot notation access.
## Session handlers
Included:
* Native php sessions
* Simple database sessions via [PDO](https://www.php.net/manual/en/book.pdo.php) (MySQL, Postgres,...)
* PSR 16 cache based sessionExternal handlers:
* [Redis](https://github.com/1ma/RedisSessionHandler)
* [PSR6 cache session adapter](https://github.com/php-cache/session-handler)You can implement any other handler or use other already existing implementations that implement the native php [SessionHandlerInterface](http://php.net/manual/en/class.sessionhandlerinterface.php).
## Example
This is a very simple example to give you an idea of how to use it:
```php
use Phauthentic\Infrastructure\Http\Session\Session;
use Phauthentic\Infrastructure\Http\Session\Config as SessionConfig;$config = (new SessionConfig())
->setSessionName('my-app')
->setGcLifeTime(60);$session = new Session($config);
$session->write('user', ['username' => 'foo']);echo $session->read('user.username');
```## Copyright & License
Licensed under the [MIT license](LICENSE.txt).
* Copyright (c) Florian Krämer
* Copyright (c) [Cake Software Foundation, Inc.](https://cakefoundation.org)