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

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

asdfdotdev/session
==================

The asdf\_ session class endeavors to make it easier to use basic best practices in PHP sessions.

0.7.0(4y ago)56562[1 PRs](https://github.com/asdfdotdev/session/pulls)LGPL-2.1-onlyPHPCI passing

Since Aug 21Pushed 3w ago3 watchersCompare

[ Source](https://github.com/asdfdotdev/session)[ Packagist](https://packagist.org/packages/asdfdotdev/session)[ RSS](/packages/asdfdotdev-session/feed)WikiDiscussions main Synced 3d ago

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

Session
=======

[](#session)

[![PHPUnit Tests (8.x)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(8.x)/badge.svg)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(8.x)/badge.svg) [![PHPUnit Tests (7.x)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(7.x)/badge.svg)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(7.x)/badge.svg) [![codecov](https://camo.githubusercontent.com/f922293bdd5fbd940c4074c58b20541a549e46c79f3b32aa46b0c66c23bbba41/68747470733a2f2f636f6465636f762e696f2f67682f61736466646f746465762f73657373696f6e2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/asdfdotdev/session) [![Packagist](https://camo.githubusercontent.com/4e2dd888a2d90bfa5103224108286b193d181d51235a459f7cc50d550d37a9b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f61736466646f746465762f73657373696f6e)](https://packagist.org/packages/asdfdotdev/session)

This class endeavors to make it easy to use better sessions in PHP scripts.

- Easily set, increment, append, hash, and drop session values
- Custom session naming
- Simple session fingerprint check
- Regenerate session id at random intervals
- Change session id length &amp; bits per character\*
- HTTPOnly session cookie
- Decoy PHPSESSID cookie
- Force session strict mode\*
- Force session use only cookies\*
- Force HTTPS only session cookies\*
- Supports PHP 7.2+

\* Requires `ini_set()` method be enabled.

### Compatibility

[](#compatibility)

[![PHP Compatibility](https://camo.githubusercontent.com/f5943e568375286155956c7fd0f69505af57a23bc184fe601a70cb7aa72694e9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e325f746f5f382e312d2532333838393242462e7376673f6c6f676f3d706870)](https://php.net/)

Session class is developed for and tested with recent PHP Version:

- PHP 7.2, 7.3, 7.4, 8.0, 8.1

Installation
------------

[](#installation)

```
composer require asdfdotdev/session

```

Use
---

[](#use)

A number of usage examples are included in `_examples/`. Check out the examples [README](./_examples/README.md) for further details.

Tests
-----

[](#tests)

Information regarding the included tests is available in the tests the [README](./_test#readme).

[Build history can be browsed at GitHub.](https://github.com/asdfdotdev/session/actions)

Standards
---------

[](#standards)

This class follows [PSR-12](https://www.php-fig.org/psr/psr-12/) code standards.

Debugging
---------

[](#debugging)

By default basic checks are performed when creating a session:

- **Session Lifespan:** Prevents min lifespan from being greater than max lifespan.
- **System Timezone:** Confirms default timezone is configured for PHP, if not UTC is set.

Additional optional debugging can be enabled in session settings:

- **PHP Version:** Confirms the version available is 7.2.0 or newer
- **Session Directory:** Confirms write access to PHP session directory
- **Session Domain:** Confirms session domain setting matches the request domain

Contributing
------------

[](#contributing)

Feedback, bug reports, feature requests, and pull requests are welcome!

If you'd like to contribute please reference our [code of conduct](./.github/CODE_OF_CONDUCT.md) and [contributing](./.github/CONTRIBUTING.md) guides.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance62

Regular maintenance activity

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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 ~230 days

Total

5

Last Release

1539d ago

### Community

Maintainers

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

---

Top Contributors

[![chrislarrycarl](https://avatars.githubusercontent.com/u/7042731?v=4)](https://github.com/chrislarrycarl "chrislarrycarl (16 commits)")

---

Tags

composer-packagephp-sessionsphp72php73php74php8sessionsessionsasdf

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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