mouf/utils.session.session-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mouf/utils.session.session-manager

最新稳定版本:v4.0.0

Composer 安装命令:

composer require mouf/utils.session.session-manager

包简介

This package is used to manage sessions. It provides a DefaultSessionManager class that you can use to configure your PHP sessions, and a SessionManagerInterface that you can implement if you want to provide your own session management.

README 文档

README

The SessionManager package is in charge of managing the session for you.

Why do we need a session manager?

PHP offers a simple way to start sessions: the session_start function. So you would we ever need to use another session mechanism?

Well, sessions can be configured in a lot of different ways. You can use session_set_save_handler to change completely the way sessions work. For instance, if you use Drupal, the sessions are stored in database. You could also configure your application to use a special "session handler".

Some components may need to access the session the way you do. So we decided to provide a simple way to initialize sessions. As a bonus, the SessionManager offers a lot of settings for managing your session graphically if you are using the Mouf framework.

Using the session manager

Just enable the package in your project. When the package is enabled, you have a sessionManager instance create.

To start a session, use:

$sessionManager->start();

To write and close a session, use:

$sessionManager->write_close();

To destroy a session, use:

$sessionManager->destroy();

To regenerate a session id, use:

$sessionManager->regenerateId();

The DefaultSessionManager class

The DefaultSessionManager uses the standard PHP mechanism to track sessions. It offers a number of parameters to configure the lifetime of a session, the path where session files are stored...

DefaultSessionManager

统计信息

  • 总下载量: 253.76k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 6
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-12-07