PHPackages                             ujjwal/auth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ujjwal/auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ujjwal/auth
===========

A Zend framework module based on ZfcUser to check if user is logged in and to manage session, session save handler etc

1.0.1(12y ago)2701PHPPHP &gt;=5.3.3

Since Dec 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/ojhaujjwal/auth)[ Packagist](https://packagist.org/packages/ujjwal/auth)[ Docs](https://github.com/ojhaujjwal/auth)[ RSS](/packages/ujjwal-auth/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

auth
====

[](#auth)

A Zend framework module based on ZfcUser to check if user is logged in and to manage session, session save handler etc.

Note
----

[](#note)

This module is currently unmaintained. Please use [HtSession](https://github.com/hrevert/HtSession) instead.

\##Requirements

- Zend Framework 2
- ZfcUser
- ZfcBase

\##Installation

- Add `"ujjwal/auth": "1.0.*",` to your composer.json and run `php composer.phar update`
- Enable the module in `config/application.config.php`
- Copy file located in `./vendor/ujjwal/auth/config/Auth.local.php` to `./config/autoload/Auth.local.php` and change the values as you wish

\##Options

Check Options available in `config/Auth.local.php`

\##Features

- Modules and Controllers Access
- Session configurations
- Session set save handler
- Session Validators

\####Modules and Controllers Access

With this module you can restrict unauthorized users from accessing certain controllers and modules. This can be done easily from module options. To do so, edit the `Auth.local.php`

```
$auth_settings = array(

    /**
     * Log In Modules
     *
     * Please set modules where logged in user can only gain access
     */
    'modules' => array(
            'Admin',
            'Application',
    ),

    /**
     * Controllers where you can set if user can access or not
     *
     * 'controllers' => array(
        'include' => array(), // Please set controllers where logged in user can only gain access

        'exclude' => array(), // Please set controllers where public user as well as logged in user can gain access
        // Note that, this part will override above `include` and `modules`
     ),
    */

);
```

#### Session configurations

[](#session-configurations)

You can set all the session options as session name, save path, save handler etc. To do so, edit the `Auth.local.php` as follows:

```
$session_settings = array(
    /**
     * Session Config Class
     *
     * Name of class used to manage session config options. Useful to create your own
     * Session Config Class.  Default is Zend\Session\Config\SessionConfig.
     * The class should implement Zend\Session\Config\ConfigInterface.
     */
    //'config_class' => 'Zend\Session\Config\SessionConfig',

    /**
     * Session Config Options
     *
     * session options such as name, save_path can be set from here
     * This is the part sent to Session Config Class. Default is empty array.
     */
    'config_options' => array(
            'name' => 'my_application',
            'save_path' => 'data/session'
    ),

);
```

#### 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:

```
$session_settings = array(
    /**
     * Use session save handler or not.
     *
     * Default is true. Useful to store session data in database
     * see http://php.net/manual/en/function.session-set-save-handler.php
     * Accept values: true and false
     */
    //'save_handler_or_not' => true,

    /**
     * Session Save Handler DI Alias
     *
     * Please specify the DI alias for the configured AuthSessionSaveHandler
     * instance that this module should use.
     * Default is AuthSessionSaveHandler which is provided by this module.
     * This class should implement Zend\Session\SaveHandler\SaveHandlerInterface
     * Note that, if above is false, this will be useless
     */
    //'saveHandler' => 'AuthSessionSaveHandler'
);
```

`Note`: Dont forget to import schema available in `data/mysql.sql` to use `session_set_save_handler`

#### 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:

```
$session_settings = array(
    /**
     * Session Validators
     *
     * Session validators provide various protection against session hijacking.
     * see http://framework.zend.com/manual/2.2/en/modules/zend.session.validator.html for more details
     */
    'validators' => array(
            'Zend\Session\Validator\RemoteAddr',
            'Zend\Session\Validator\HttpUserAgent',
    ),
);
```

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

[](#ending-thoughts)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~169 days

Total

2

Last Release

4418d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4995501?v=4)[Ujjwal Ojha](/maintainers/ojhaujjwal)[@ojhaujjwal](https://github.com/ojhaujjwal)

---

Top Contributors

[![ojhaujjwal](https://avatars.githubusercontent.com/u/4995501?v=4)](https://github.com/ojhaujjwal "ojhaujjwal (27 commits)")

---

Tags

zf2

### Embed Badge

![Health badge](/badges/ujjwal-auth/health.svg)

```
[![Health](https://phpackages.com/badges/ujjwal-auth/health.svg)](https://phpackages.com/packages/ujjwal-auth)
```

###  Alternatives

[socalnick/scn-social-auth

Uses the HybridAuth PHP library to Enable authentication via Google, Facebook, Twitter, Yahoo!, etc for the ZfcUser ZF2 module.

21674.9k3](/packages/socalnick-scn-social-auth)[goalio/goalio-forgotpassword

Adding Forgot Password functionalitiy to ZfcUser

4362.3k1](/packages/goalio-goalio-forgotpassword)[goalio/goalio-rememberme

Adding Remember Me functionalitiy to ZfcUser

3243.7k3](/packages/goalio-goalio-rememberme)[mtudor/zfc-user-impersonate

Facilitate impersonation of other users in ZfcUser.

10118.4k](/packages/mtudor-zfc-user-impersonate)[nitecon/zfcuser-ldap

Zend Framework 2 ZfcUser LDAP Authentication

154.2k1](/packages/nitecon-zfcuser-ldap)[hrevert/ht-user-registration

A Zend Framework 2 module which extends the registration feature of ZfcUser with email address verification

144.8k2](/packages/hrevert-ht-user-registration)

PHPackages © 2026

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