PHPackages                             hrevert/ht-session - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hrevert/ht-session

ActiveLibrary

hrevert/ht-session
==================

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

1.2.0(11y ago)123.0k7[2 issues](https://github.com/hrevert/HtSession/issues)MITPHPPHP &gt;=5.4

Since Jan 11Pushed 11y ago6 watchersCompare

[ Source](https://github.com/hrevert/HtSession)[ Packagist](https://packagist.org/packages/hrevert/ht-session)[ Docs](https://github.com/hrevert/HtSession)[ RSS](/packages/hrevert-ht-session/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

HtSession
=========

[](#htsession)

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

\##Requirements

- [Zend Framework 2](https://github.com/zendframework/zf2)

\##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`

\##Features

- Session configurations
- Session set save handler
- Session Validators

#### Session configurations

[](#session-configurations)

You can set all the session options as session name, save path etc.

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

#### Session set save handler

[](#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:

```
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`

If you use [Doctrine DBAL](https://github.com/doctrine/dbal):

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

#### Session Validators

[](#session-validators)

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

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

For more detailed description, click [here](https://github.com/hrevert/HtSession/blob/master/docs/Session%20Validators.md).

Ending Thoughts
---------------

[](#ending-thoughts)

Dont forget to fork this module and send pull request to make this module even better!

[![Bitdeli Badge](https://camo.githubusercontent.com/552aeba209588fa728228c207187d39e69e098c4eecbec42ff61e14bc36afa89/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f687265766572742f687473657373696f6e2f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~34 days

Total

7

Last Release

4343d ago

PHP version history (2 changes)1.0.0-beta1PHP &gt;=5.3.3

1.2.0-beta1PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a78ca1505c93127e0ac82e195481baf87cb6f3fae3bd4dcc18b5cfb85ce425ed?d=identicon)[hrevert](/maintainers/hrevert)

---

Top Contributors

[![ojhaujjwal](https://avatars.githubusercontent.com/u/4995501?v=4)](https://github.com/ojhaujjwal "ojhaujjwal (29 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

---

Tags

sessionmodulezf2

### Embed Badge

![Health badge](/badges/hrevert-ht-session/health.svg)

```
[![Health](https://phpackages.com/badges/hrevert-ht-session/health.svg)](https://phpackages.com/packages/hrevert-ht-session)
```

###  Alternatives

[hrevert/ht-img-module

Image manipulation module for Zend Framework 2

1829.6k2](/packages/hrevert-ht-img-module)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
