legalthings/mongodb-session-handler
Composer 安装命令:
composer require legalthings/mongodb-session-handler
包简介
A session handler that stores structured data in MongoDB
README 文档
README
The LegalThings MongoDB session handler stores sessions as structured data in MongoDB. This allows a process to fetch and modify or remove a session based on its data.
Use cases
Remove user sessions when a password changes
When you change your password, you want to remove all the other sessions of the user. This is a security measure, the old password may be comprimised and a hacker may already have logged in. Without invalidating his session, he can continue to use the user account even after the password has changed.
Cache and update user information
For performance reasons you might store the user's information like name, image, team name, etc in the session. When a team changes it's name, you want to find all the sessions of the users within that team and update the information.
Installation
composer require legalthings/mongodb-session-handler
This libary uses the legacy Mongo driver. If you're running PHP7 or simply are already using the new MongoDB
driver, please install alcaeus/mongo-php-adapter.
Usage
$mongo = new MongoClient(); $collection = $mongo->some_db->sessions; $handler = new MongodbSessionHandler($collection); session_set_save_handler($handler);
To create read-only sessions use new MongodbSessionHandler($collection, 'r')
legalthings/mongodb-session-handler 适用场景与选型建议
legalthings/mongodb-session-handler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.99k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 legalthings/mongodb-session-handler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 legalthings/mongodb-session-handler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-12