承接 akrabat/akrabat-session 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

akrabat/akrabat-session

最新稳定版本:1.0

Composer 安装命令:

composer require akrabat/akrabat-session

包简介

A Zend Framework 2 module for configuring sessions

README 文档

README

#AkrabatSession

This ZF2 module is intended to make it simple to change the settings of a session; specifically the most common change required is to set a name for the cookie used to hold the session id.

##Installation

You have a number of choices for installing AkrabatSession:

with Composer

Add "akrabat/akrabat-session": "dev-master" to your composer.json file and run php composer.phar update.

as a Git Submodule

Clone this project into your ./vendor/ directory:

    git submodule add git://github.com/akrabat/AkrabatSession.git vendor/AkrabatSession

You can also just clone the module into your ./vendor/ directory or download it via the 'Zip' button on github.

Configuration

Once you have installed AkrabatSession, you need to enable it by editing config/application.config.php and adding AkrabatSession to the modules section.

To configure the session as you required, add the following to your config/autoload/global.php file:

    'session' => array(
        'name' => 'MY_SESSION_NAME_HERE',
    ),

Add additional configuration keys as needed.

Available configuration keys

The available configuration options are in the Zend\Session\Config\SessionConfig and Zend\Session\Config\StandardConfig classes. Most map to the PHP level session directives

Some of the more useful ones are:

  • name - Name of the session
  • remember_me_seconds - Number of seconds to make session sticky, when rememberMe() is called. Default is 2 weeks (1209600 seconds)
  • save_path - By default, the path where the session files are created
  • cookie_httponly - Marks the cookie as accessible only through the HTTP protocol.
  • use_only_cookies - Specifies that only cookies are used and not session ids in URLs
  • cookie_secure - Specifies that cookies should only be sent over secure connections

Note: AkrabatSession sets the cookie_httponly and use_only_cookies settings to true

Session storage and save handler classes

If you need to set the SessionMangers's storage or save handler class, then simply create a ServiceManager alias of session_storage or session_save_handler.

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 4
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2012-11-10