PHPackages                             websoftwares/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. websoftwares/session

ActiveLibrary

websoftwares/session
====================

PHP 5.3+ Session Class that accepts optional save handlers.

0.1.1(12y ago)225DBADPHPPHP &gt;=5.3.0

Since Aug 22Pushed 12y agoCompare

[ Source](https://github.com/websoftwares/Session)[ Packagist](https://packagist.org/packages/websoftwares/session)[ RSS](/packages/websoftwares-session/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

Session
=======

[](#session)

PHP 5.3+ Session Class that accepts optional save handlers.

[![Build Status](https://camo.githubusercontent.com/5019978e111f152b20f3769169d48e0b5e51fe8fbb244808f9a3be1bd440c8f8/68747470733a2f2f6170692e7472617669732d63692e6f72672f776562736f667477617265732f53657373696f6e2e706e67)](https://travis-ci.org/websoftwares/Session)

Installing via Composer (recommended)
-------------------------------------

[](#installing-via-composer-recommended)

Install composer in your project:

```
curl -s http://getcomposer.org/installer | php

```

Create a composer.json file in your project root:

```
{
    "require": {
        "websoftwares/session": "dev-master"
    }
}

```

Install via composer

```
php composer.phar install

```

Usage
-----

[](#usage)

Basic usage of the `Session` class.

```
use Websoftwares\Session;

// Instantiate class
$session = new Session;

// Start session
$session->start();

// Store in session
$session["key"] = 'value';

var_dump($_SESSION);

// Destroy
$session->destroy();
```

Options
-------

[](#options)

U can override the default options by instantiating a `Session` class and pass in an *array* as the second argument.

```
$options = array(
    // If enabled (default) extra meta data is added (name,created,updated)
    'meta' => true,
    // Provide custom session name
    'name' => null,
    'lifetime' => 0,
    'path' => '/',
    'domain' => null,
    'secure' => true,
    'httponly' => false
);

// Instantiate class
$session = new Session(null,$options);
```

start();
--------

[](#start)

Start a new session.

```
$session->start();
```

destroy();
----------

[](#destroy)

Destory the session.

```
$session->destroy();
```

close();
--------

[](#close)

Close the session.

```
$session->close();
```

active();
---------

[](#active)

Find out if their is a session active.

```
$session->active();
```

id($string);
------------

[](#idstring)

Set session id, Get current/previous session id.

```
$session->id($string);
```

regenerate();
-------------

[](#regenerate)

Regenerate session id, optional bool true for session deletion.

```
$session->regenerate();
```

ArryAccess
----------

[](#arryaccess)

U can access the session object as an array.

```
$session["key"] = "value";
```

Testing
-------

[](#testing)

In the tests folder u can find several tests.

License
-------

[](#license)

[DBAD](http://www.dbad-license.org/ "DBAD") Public License.

Acknowledgement
---------------

[](#acknowledgement)

All the great session managment solutions.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Total

9

Last Release

4685d ago

### Community

Maintainers

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

---

Tags

session

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

49019.6M575](/packages/nette-http)[yiisoft/yii2-redis

Redis Cache, Session and ActiveRecord for the Yii framework

44912.1M264](/packages/yiisoft-yii2-redis)[laminas/laminas-session

Object-oriented interface to PHP sessions and storage

8223.7M126](/packages/laminas-laminas-session)[aura/session

Provides session management functionality, including lazy session starting, session segments, next-request-only ("flash") values, and CSRF tools.

2051.2M76](/packages/aura-session)[mezzio/mezzio-session

Session container and middleware for PSR-7 applications

241.1M21](/packages/mezzio-mezzio-session)

PHPackages © 2026

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