{"id":21026266,"url":"https://github.com/detain/session-samurai","last_synced_at":"2025-05-15T10:31:24.510Z","repository":{"id":65929798,"uuid":"602647337","full_name":"detain/session-samurai","owner":"detain","description":"🥷 Universal high-speed asynchronous (non-blocking) SessionHandlerInterface implementation for PHP supporting Semaphores, Mysqli, Redis, SQLite3, Symfony/Cache, WinCache, PhpFastCache, PHP-Cache, PDO, Memcached, FlySystem Filesystem, Illuminate, APCu, APC, OpCache, InfluxDB, WinCache, MongoDb and local file storage.","archived":false,"fork":false,"pushed_at":"2025-05-12T10:14:06.000Z","size":191,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T10:39:33.357Z","etag":null,"topics":["asynchronous","flysystem","memcached","mongodb","mysql","mysqli","non-blocking","pdo","php","php-cache","phpfastcache","redis","semaphore","session","session-management","sessionhandler","sessionhandlerinterface","sqlite3","symfony-cache","wincache"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/detain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-16T16:46:44.000Z","updated_at":"2025-05-12T10:14:10.000Z","dependencies_parsed_at":"2024-02-03T09:40:26.349Z","dependency_job_id":null,"html_url":"https://github.com/detain/session-samurai","commit_stats":{"total_commits":66,"total_committers":3,"mean_commits":22.0,"dds":"0.030303030303030276","last_synced_commit":"3ced23ee862e2174c0004ace17e12500fb1112f7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fsession-samurai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fsession-samurai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fsession-samurai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fsession-samurai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/detain","download_url":"https://codeload.github.com/detain/session-samurai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253724945,"owners_count":21953952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","flysystem","memcached","mongodb","mysql","mysqli","non-blocking","pdo","php","php-cache","phpfastcache","redis","semaphore","session","session-management","sessionhandler","sessionhandlerinterface","sqlite3","symfony-cache","wincache"],"created_at":"2024-11-19T11:44:03.269Z","updated_at":"2025-05-15T10:31:24.498Z","avatar_url":"https://github.com/detain.png","language":"PHP","readme":"# Session Samurai 🥷\n\n[![check](https://github.com/detain/session-samurai/actions/workflows/check.yml/badge.svg)](https://github.com/detain/session-samurai/actions/workflows/check.yml)\n\nUniversal high-speed asynchronous (non-blocking) SessionHandlerInterface implementation for PHP supporting Semaphores, Mysqli, Redis, SQLite3, Symfony/Cache, WinCache, PhpFastCache, PHP-Cache, PDO, Memcached, FlySystem Filesystem, Illuminate, APCu, APC, OpCache, InfluxDB, WinCache, MongoDb and local file storage.\n\n\"_Session handling is like a sword fight_\u003cbr\u003e\n_You must think first before you move_\u003cbr\u003e\n_When it's properly used it's almost invincible_\"\n\n\n## Project Status\n\n*Session Samurai 🥷* is fresh off the block and is still figuring out what it wants to do with its life.  Soon it will grow into a mega-hotie that does the same stuff others do, only he makes it look good.\n\n\n## Installation\n\nUse [composer](http://getcomposer.org/) to include the save handler in your application.\n```bash\ncomposer requre detain/session-samurai\n```\n\n## Usage\n\n### Using Memcached\n\n```php\nrequire 'vendor/autoload.php';  // set up autoloading using composer\n\n$memcached = new \\Memcached();  // create connection to memcached\n$memcached-\u003eaddServer('localhost', 11211);\n$handler = new \\Detain\\SessionSamurai\\MemcachedSessionHandler($memcached);\nsession_set_save_handler($handler, true);\n```\n\n### Using Redis\n\n```php\n$redis = new \\Redis();\n$redis-\u003econnect('127.0.0.1', 6379);\n$handler = new \\Detain\\SessionSamurai\\RedisSessionHandler($redis);\nsession_set_save_handler($handler, true);\n```\n\n## Development notes\n\n\n### Related sites with possibly good reference material\n\n* [PHP: SessionHandlerInterface](https://www.php.net/manual/en/class.sessionhandlerinterface.php) - Manual\n* [PHP: session_set_save_handler](https://www.php.net/manual/en/function.session-set-save-handler.php) - Manual\n* [PHP: Securing Session INI Settings](https://www.php.net/manual/en/session.security.ini.php) - Manual\n* [Session Handler Life Cycle](https://gist.github.com/franksacco/d6e943c41189f8ee306c182bf8f07654): A complete overview of the php session handler life cycle]\n* [1ma/RedisSessionHandler](https://github.com/1ma/RedisSessionHandler): An alternative Redis session handler for PHP featuring per-session locking and session fixation protection\n* [cballou/MongoSession](https://github.com/cballou/MongoSession): A PHP session handler wrapped around MongoDB.\n* [josantonius/php-session](https://github.com/josantonius/php-session): PHP library for handling sessions\n* [psr7-sessions/storageless](https://github.com/psr7-sessions/storageless): storage-less PSR-7 session support\n* [ramazancetinkaya/session-handler](https://github.com/ramazancetinkaya/session-handler): A PHP library for secure session handling.\n* [davidlienhard/sessionhandler](https://github.com/davidlienhard/sessionhandler): 🐘 php sessionhandler using database connection\n* [zahycz/sessionless](https://github.com/zahycz/sessionless): Non-I/O blocking SessionHandler implementation using Nette/Caching\n* [javis/php-memcached-sessions](https://github.com/javis/php-memcached-sessions): A PHP session handler that uses memcached to store session with multiple servers, failover and replication support.\n* [PHP Cache](https://www.php-cache.com/en/latest/) - PHP-Cache Documentation\n* [The Cache Component](https://symfony.com/doc/current/components/cache.html#available-cache-adapters) (Symfony Docs)\n* [The Lock Component](https://symfony.com/doc/current/components/lock.html#available-stores) (Symfony Docs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetain%2Fsession-samurai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdetain%2Fsession-samurai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetain%2Fsession-samurai/lists"}