2017 © Pedro Peláez
 

library session

Manage session data.

image

codezero/session

Manage session data.

  • Monday, March 30, 2015
  • by codezero
  • Repository
  • 2 Watchers
  • 0 Stars
  • 876 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

Session

GitHub release License Build Status Scrutinizer Total Downloads, (*1)

Manage session data.

This package includes an adapter for Laravel's Session Store, to enable the use of other implementations in non-Laravel projects., (*2)

Installation

Install this package through Composer:, (*3)

composer require codezero/session

Vanilla PHP Implementation

Autoload the vendor classes:, (*4)

require_once 'vendor/autoload.php'; // Path may vary

And then use the VanillaSession implementation:, (*5)

$session = new \CodeZero\Session\VanillaSession();

Laravel 5 Implementation

Add a reference to LaravelSessionServiceProvider to the providers array in config/app.php:, (*6)

'providers' => [
    'CodeZero\Session\LaravelSessionServiceProvider'
]

Then you can "make" (or inject) a Cookie instance anywhere in your app:, (*7)

$session = \App::make('CodeZero\Session\Session');

TIP: Laravel's IoC container will automatically provide the Laravel specific Session implementation. This will use Laravel's Session goodness behind the scenes!, (*8)

Usage

Store data in the session

$session->store('key', 'value');
$session->store('key', ['array' => 'value']);

Get session data

If a key doesn't exist, null will be returned., (*9)

$array = $session->get(); // An array of all data
$value = $session->get('key'); // Specific data

Delete session data

$session->flush(); // Clear all data
$session->delete('key'); // Clear specific data

Destroy the session

This will flush all data and regenerate the session ID., (*10)

$session->destroy();

Testing

$ vendor/bin/phpspec run

Security

If you discover any security related issues, please e-mail me instead of using the issue tracker., (*11)

License

The MIT License (MIT). Please see License File for more information., (*12)


Analytics, (*13)

The Versions

30/03 2015

dev-master

9999999-dev

Manage session data.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Ivan Vermeyen

laravel php session

30/03 2015

1.0.0

1.0.0.0

Manage session data.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Ivan Vermeyen

laravel php session