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

ActiveLibrary

icanboogie/session
==================

Manage sessions

v3.0.0(4y ago)32.4k↑1900%1BSD-3-ClausePHPPHP &gt;=7.2

Since Apr 6Pushed 1y agoCompare

[ Source](https://github.com/ICanBoogie/Session)[ Packagist](https://packagist.org/packages/icanboogie/session)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-session/feed)WikiDiscussions 6.0 Synced 2mo ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

Session
=======

[](#session)

[![Release](https://camo.githubusercontent.com/6359d56f2e4ef5edf428c1ce09ae314b21afe69bcad81912dbc241c20d303aa3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f73657373696f6e2e737667)](https://packagist.org/packages/icanboogie/session)[![Code Coverage](https://camo.githubusercontent.com/ba9882e393a4b36ce09c779e3b356652dde998361656ae67b2081b6d78621f37/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f53657373696f6e2f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/Session?branch=6.0)[![Packagist](https://camo.githubusercontent.com/03cc8ef63e7bdf476090dd8201dadf8a2130217cd1a1ecbbb8313339392ade53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f73657373696f6e2e737667)](https://packagist.org/packages/icanboogie/session)

The **icanboogie/session** package provides an interface to easily manage PHP sessions. You create a session instance with the desired options and the session is automatically started when reading or writing. The session instance is used as an array, just like `$_SESSION`. You can provide *session segments* to your components so that they have a safe place to store their own session values. Flash values can be used in the session and its segments. Finally, you can use the *session token* with unsafe HTTP methods to prevent [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery).

It is important to keep in mind that the session instance it basically mapping the `$_SESSION` array and `session_*` functions, thus you don't need to change anything in your application setup. You may use Redis to store sessions and some fancy session handler, it makes no difference.

The following code demonstrates some usages of the session instance:

```
