2017 © Pedro Peláez
 

library akrabat-session

A Zend Framework 2 module for configuring sessions

image

akrabat/akrabat-session

A Zend Framework 2 module for configuring sessions

  • Sunday, November 13, 2016
  • by akrabat
  • Repository
  • 4 Watchers
  • 13 Stars
  • 2,831 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

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., (*1)

Installation

You have a number of choices for installing AkrabatSession:, (*2)

with Composer

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

as a Git Submodule

Clone this project into your ./vendor/ directory:, (*4)

    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., (*5)

Configuration

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

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

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

Add additional configuration keys as needed., (*8)

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, (*9)

Some of the more useful ones are:, (*10)

  • 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, (*11)

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., (*12)

The Versions

13/11 2016

dev-master

9999999-dev https://github.com/akrabat/AkrabatSession

A Zend Framework 2 module for configuring sessions

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 zendframework session

13/11 2016

1.0

1.0.0.0 https://github.com/akrabat/AkrabatSession

A Zend Framework 2 module for configuring sessions

  Sources   Download

BSD-3-Clause

The Requires

 

zf2 zendframework session