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

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

eden/session
============

Sever Side Persistent Data

4.0.1(10y ago)07.7k1MITPHPPHP &gt;=5.3.1

Since Oct 7Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Eden-PHP/Session)[ Packagist](https://packagist.org/packages/eden/session)[ Docs](http://eden-php.com)[ RSS](/packages/eden-session/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

[![logo](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67)](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67) Eden Session
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-eden-session)

[![Build Status](https://camo.githubusercontent.com/f3bf1f480d162acb17b043187d2967eea02189a60f37d99110261012966bda4c/68747470733a2f2f6170692e7472617669732d63692e6f72672f4564656e2d5048502f53657373696f6e2e706e67)](https://travis-ci.org/Eden-PHP/Session)
===========================================================================================================================================================================================================================================================

[](#)

- [Install](#install)
- [Introduction](#intro)
- [API](#api)
    - [clear](#clear)
    - [get](#get)
    - [getId](#getId)
    - [remove](#remove)
    - [set](#set)
    - [setId](#setId)
    - [start](#start)
    - [stop](#stop)
- [Contributing](#contributing)

====

Install
-------

[](#install)

`composer install eden/session`

====

Introduction
------------

[](#introduction)

Before using sessions, it's probably a good idea to start the session.

```
$session = eden('session')->start();

```

The session returned is an array object and can be used like a normal array.

```
$session['me']    = array('name' => 'John', 'age' => 31);
$session['you']    = array('name' => 'Jane', 'age' => 28);
$session['him']    = array('name' => 'Jack', 'age' => 35);

foreach($session as $key => $value) {
	echo $value['name'];
}

```

====

### clear

[](#clear)

Removes all session data

#### Usage

[](#usage)

```
eden('session')->clear();

```

#### Parameters

[](#parameters)

Returns `Eden\Session\Index`

====

### get

[](#get)

Returns data

#### Usage

[](#usage-1)

```
eden('session')->get(string|null $key);

```

#### Parameters

[](#parameters-1)

- `string|null $key` - The key from the session

Returns `scalar|null|array`

#### Example

[](#example)

```
eden('session')->get();

```

====

### getId

[](#getid)

Returns session id

#### Usage

[](#usage-2)

```
eden('session')->getId();

```

#### Parameters

[](#parameters-2)

Returns `int`

====

### remove

[](#remove)

Removes a session.

#### Usage

[](#usage-3)

```
eden('session')->remove(*string $name);

```

#### Parameters

[](#parameters-3)

- `*string $name` - session name

Returns `Eden\Session\Index`

#### Example

[](#example-1)

```
eden('session')->remove('foo');

```

====

### set

[](#set)

Sets data

#### Usage

[](#usage-4)

```
eden('session')->set(*array|string $data, mixed $value);

```

#### Parameters

[](#parameters-4)

- `*array|string $data` - The array data to set
- `mixed $value` - If data is a key then this is the value

Returns `Eden\Session\Index`

#### Example

[](#example-2)

```
eden('session')->set(array('foo' => 'bar'));

```

====

### setId

[](#setid)

Sets the session ID

#### Usage

[](#usage-5)

```
eden('session')->setId(*int $id);

```

#### Parameters

[](#parameters-5)

- `*int $id` - The prescribed session ID to use

Returns `int`

#### Example

[](#example-3)

```
eden('session')->setId(123);

```

====

### start

[](#start)

Starts a session

#### Usage

[](#usage-6)

```
eden('session')->start();

```

#### Parameters

[](#parameters-6)

Returns `Eden\Session\Index`

====

### stop

[](#stop)

Starts a session

#### Usage

[](#usage-7)

```
eden('session')->stop();

```

#### Parameters

[](#parameters-7)

Returns `Eden\Session\Index`

====

\#Contributing to Eden

Contributions to *Eden* are following the Github work flow. Please read up before contributing.

\##Setting up your machine with the Eden repository and your fork

1. Fork the repository
2. Fire up your local terminal create a new branch from the `v4` branch of your fork with a branch name describing what your changes are. Possible branch name types:
    - bugfix
    - feature
    - improvement
3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

\##Making pull requests

1. Please ensure to run `phpunit` before making a pull request.
2. Push your code to your remote forked version.
3. Go back to your forked version on GitHub and submit a pull request.
4. An Eden developer will review your code and merge it in when it has been classified as suitable.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

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

Total

3

Last Release

3839d ago

PHP version history (2 changes)v4PHP &gt;=5.3.1

4.x-devPHP &gt;=5.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120378?v=4)[Christian Blanquera](/maintainers/cblanquera)[@cblanquera](https://github.com/cblanquera)

---

Top Contributors

[![clark21](https://avatars.githubusercontent.com/u/5639521?v=4)](https://github.com/clark21 "clark21 (7 commits)")

---

Tags

libraryeden

### Embed Badge

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

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

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)[eden/core

Eden Core component full of secret sauce

14415.0k34](/packages/eden-core)

PHPackages © 2026

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