PHPackages                             toropyga/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. toropyga/session

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

toropyga/session
================

Libraries for working with sessions from Toropyga

v3.0.2(3w ago)0258MITPHPPHP &gt;=5.1.0

Since Aug 11Pushed 3w ago1 watchersCompare

[ Source](https://github.com/Toropyga/Session)[ Packagist](https://packagist.org/packages/toropyga/session)[ RSS](/packages/toropyga-session/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (13)Used By (0)

Session
=======

[](#session)

A library for working with sessions in PHP

[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)[![Version](https://camo.githubusercontent.com/b5e0a1b647f06e5a99cc05b0aa364f684300adb867e4fc529f3c87bbc1912535/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d76332e302e322d626c75652e737667)](https://camo.githubusercontent.com/b5e0a1b647f06e5a99cc05b0aa364f684300adb867e4fc529f3c87bbc1912535/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d76332e302e322d626c75652e737667)[![PHP](https://camo.githubusercontent.com/f85e9a1e19d96dd19978f3b621237a876e188c358f8ed0908fea7d51eda1a225/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d76352e355f2d2d5f76382d626c756576696f6c65742e737667)](https://camo.githubusercontent.com/f85e9a1e19d96dd19978f3b621237a876e188c358f8ed0908fea7d51eda1a225/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d76352e355f2d2d5f76382d626c756576696f6c65742e737667)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Installation](#installation)
- [Configuration](#configuration)
- [Getting started](#getting-started)
- [Usage example](#usage-example)

Overview
--------

[](#overview)

The Session class is a library for working with sessions in PHP. It requires PHP version 5 or higher. It can store user session data in a database. It works with MySQL and PostgreSQL databases. It automatically creates a table in the database, if one does not already exist, to store session data.

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

[](#installation)

The recommended way to install the Session library is using [Composer](http://getcomposer.org/):

```
composer require toropyga/session
```

Configuration
-------------

[](#configuration)

Default parameters can be pre-configured either directly in the class itself, or by using named constants. Named constants, if needed, should be defined before the class is called — for example, in a configuration file — and they determine the default settings.

- SE\_LIVETIME - lifetime of a simple (guest) session, in seconds
- SE\_LIVETIME\_REM - lifetime of a saved (remembered) session, in seconds
- SE\_NAME - session name
- SE\_USEDB - whether to use a database (true|false)
- SE\_SECURE - the "secure" security parameter for the COOKIE (true|false)
- SE\_HTTPONLY - the "httponly" security parameter for the COOKIE (true|false)
- SE\_SAMESITE - cross-domain cookie transfer policy (lax|strict|none)
- SE\_USE\_TMPL - create a dedicated directory (folder) for storing session files (true|false)
- SE\_TMPL\_NAME - name of the directory used to store sessions
- SE\_USE\_SERVER\_NAME - use the server name when creating the directory (true|false)
- SE\_USE\_SDIR - use the standard folder for storing sessions (true|false)
- SE\_LOG\_NAME - name of the file the log is saved to
- SE\_DEBUG - enable or disable debugging and logging

Getting started
---------------

[](#getting-started)

```
require_once("vendor/autoload.php");
```

Initialize the class

```
$SE = new Toropyga\Session();
```

Usage example
-------------

[](#usage-example)

```
$SE = new Toropyga\Session();
$SE->setDebug(true); // enable debugging
$SE->sessionInit();
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Recently: every ~0 days

Total

12

Last Release

21d ago

Major Versions

v2.2.3 → v3.0.02026-07-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/57900903?v=4)[Toropyga](/maintainers/Toropyga)[@Toropyga](https://github.com/Toropyga)

---

Top Contributors

[![Toropyga](https://avatars.githubusercontent.com/u/57900903?v=4)](https://github.com/Toropyga "Toropyga (21 commits)")

### Embed Badge

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

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

###  Alternatives

[illuminate/collections

The Illuminate Collections package.

27180.6M1.2k](/packages/illuminate-collections)

PHPackages © 2026

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