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

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

sun/session
===========

This package helps you to manage your session easily.

v1.2(10y ago)0741MITPHPPHP &gt;=5.4.0

Since Jul 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/IftekherSunny/Session)[ Packagist](https://packagist.org/packages/sun/session)[ RSS](/packages/sun-session/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

Session
-------

[](#session)

[![Total Downloads](https://camo.githubusercontent.com/bab6f373d6669f8799d31acec0e4a53fee355c3493acaf4a0045a3bae8c701b4/68747470733a2f2f706f7365722e707567782e6f72672f73756e2f73657373696f6e2f646f776e6c6f616473)](https://packagist.org/packages/sun/session) [![Latest Stable Version](https://camo.githubusercontent.com/7ad42040f025b0be843ebe7bb5018870f42a0c5ac3f9d364532b136a6c309eee/68747470733a2f2f706f7365722e707567782e6f72672f73756e2f73657373696f6e2f762f737461626c65)](https://packagist.org/packages/sun/session) [![Latest Unstable Version](https://camo.githubusercontent.com/b49f764416d237c3952d580a47c05bd06ee50981f22054950f1689cdc45aabc6/68747470733a2f2f706f7365722e707567782e6f72672f73756e2f73657373696f6e2f762f756e737461626c65)](https://packagist.org/packages/sun/session) [![License](https://camo.githubusercontent.com/7c613b7f8868329e62f0f29bec1450b1c1f05229d9d38bc1162ca9f2abe12ffc/68747470733a2f2f706f7365722e707567782e6f72672f73756e2f73657373696f6e2f6c6963656e7365)](https://packagist.org/packages/sun/session)

Session helps you to manage your session data easily.

Installation Process
--------------------

[](#installation-process)

Just copy Session folder somewhere into your project directory. Then include session autoloader.

```
 require_once('/path/to/Session/autoload.php');
```

Session is also available via Composer/Packagist.

```
 composer require sun/session

```

All Methods
-----------

[](#all-methods)

###### To store session data

[](#to-store-session-data)

```
$session = new Sun\Session;
$session->create('login', 'username');
```

###### To get session data

[](#to-get-session-data)

```
$session->get('login');
```

You can also set default value for session get method.

```
$session->get('login', 'users');
```

###### To delete session data

[](#to-delete-session-data)

```
$session->get('login');
```

###### To check session exists

[](#to-check-session-exists)

```
$session->has('login');
```

###### To pull session data

[](#to-pull-session-data)

The pull method retrieve session data then delete this session immediately.

```
$session->pull('login');
```

You can also set default value for session pull method.

```
$session->pull('login','users');
```

###### To push session data into session array

[](#to-push-session-data-into-session-array)

```
$session->push('login', ['user']);
```

###### To pop session data from session array

[](#to-pop-session-data-from-session-array)

```
$session->pop('login');
```

###### To shift session data from session array

[](#to-shift-session-data-from-session-array)

```
$session->shift('login');
```

###### To destroy all session data

[](#to-destroy-all-session-data)

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

License
-------

[](#license)

This package is licensed under the [MIT License](https://github.com/IftekherSunny/session/blob/master/LICENSE)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3950d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d233b865d7b1e1b86271e3bc70ddd077e1c01e4a83124e020fa39199c4af15a?d=identicon)[IftekherSunny](/maintainers/IftekherSunny)

---

Top Contributors

[![IftekherSunny](https://avatars.githubusercontent.com/u/8013399?v=4)](https://github.com/IftekherSunny "IftekherSunny (5 commits)")

---

Tags

phpauthsessionphp sessionlaravel like session

### Embed Badge

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

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

###  Alternatives

[cartalyst/sentinel

PHP 8.2+ Fully-featured Authentication &amp; Authorization System

1.6k2.7M72](/packages/cartalyst-sentinel)[hyperf-ext/jwt

The Hyperf JWT package.

53134.9k2](/packages/hyperf-ext-jwt)[hyperf-ext/auth

The Hyperf Auth package.

2376.2k3](/packages/hyperf-ext-auth)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)

PHPackages © 2026

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