2017 © Pedro Peláez
 

library zf2-htsession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

image

jbmchd/zf2-htsession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  • Saturday, February 11, 2017
  • by jbmchd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database., (*1)

Requirements

Installation

  • Add "hrevert/ht-session": "1.1.*", to your composer.json and run php composer.phar update
  • Enable the module in config/application.config.php
  • Copy file located in ./vendor/hrevert/ht-session/config/HtSession.global.php to ./config/autoload/HtSession.global.php and change the values as you wish

Options

Check Options available in config/HtSession.global.php, (*2)

Features

  • Session configurations
  • Session set save handler
  • Session Validators

Session configurations

You can set all the session options as session name, save path etc., (*3)

return [
   'htsession' => [
       'config_options' => array(
              'name' => 'my_application',
              'save_path' => 'data/session'
        ),
        'storage' => 'Zend\Session\Storage\SessionArrayStorage',
     ]
];

Session set save handler

This module also comes with session set save handler to store session data in database. By default session_set_save_hander is already enabled. If you want to disable it, disable it in the following settings:, (*4)

return [
   'htsession' => [
      'enable_session_set_save_handler' => true, // false if you don`t want to store session data in database
   ],
   'service_manager' => [
      'aliases' => [
         'HtSessionDbAdapter' => 'Zend\Db\Adapter\Adapter', // your database adapter here
         'HtSession\SessionSetSaveHandler' => 'HtSession\DefaultSessionSetSaveHandler'
      ]
   ]
];

Note: Dont forget to import schema available in data/mysql.sql to use session_set_save_handler, (*5)

If you use Doctrine DBAL:, (*6)

return [
   'service_manager' => [
      'aliases' => [
         'HtSession\SessionSetSaveHandler' => 'HtSession\DoctrineDbalSessionSetSaveHandler'
      ]
   ]
];

Session Validators

You can set validators provided by Zend Framework 2 with ease. Change the following as you wish in the config file:, (*7)

return [
   'htsession' => [
       'validators' => array(
           'Zend\Session\Validator\RemoteAddr',
           'Zend\Session\Validator\HttpUserAgent',    
        ),      
   ]
];

For more detailed description, click here., (*8)

Ending Thoughts

Dont forget to fork this module and send pull request to make this module even better!, (*9)

Bitdeli Badge, (*10)

The Versions

11/02 2017

dev-master

9999999-dev https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

MIT

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2 module session

23/06 2014

1.2.0

1.2.0.0 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

MIT

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2 module session

23/06 2014

1.2.0-beta2

1.2.0.0-beta2 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

MIT

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2 module session

27/05 2014

dev-check-cli

dev-check-cli https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2

04/04 2014

1.2.0-beta1

1.2.0.0-beta1 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

MIT

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2 module session

10/02 2014

1.1.0

1.1.0.0 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2

08/02 2014

1.1.0-beta1

1.1.0.0-beta1 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2

22/01 2014

1.0.0

1.0.0.0 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2

11/01 2014

1.0.0-beta1

1.0.0.0-beta1 https://github.com/hrevert/HtSession

A Zend Framework 2 module to manage session configurations, session validators, storing session data in database.

  Sources   Download

The Requires

 

by Avatar ojhaujjwal
by Hrevert Technologies

zf2