cyrill/sucre-session

0.0.3 2015-02-09 09:19 UTC

This package is not auto-updated.

Last update: 2024-04-13 12:53:44 UTC


README

Sucre/Session is simple loosely-coupled PHP $_SESSION wrapper.

Requirement

  • PHP 5.4 or later

Installation

Download the composer.phar.

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

Run Composer: php composer.phar require "cyrill/sucre-session"

Usage

<?php
reqire __DIR__.'/composer/autoload.php';

use Sucre\Session;

Session::init($regenerate = true); // start session

Session::set('foo', 'bar'); // $_SESSION['foo'] = 'bar';
Session::get('foo'); // returns 'bar'

Session::setFlash('foofoo', 'barbar');
Session::getFlash('foofoo'); // returns 'barbar'

Session::generateId();
Session::destroy();

How to test?

Sucre\Session is tested by PHPUnit.

Run composer composer install --dev. All you have to do is to run phpunit.

License

The MIT License