2017 © Pedro Peláez
 

library session

A simple PHP native session wrapper

image

which1ispink/session

A simple PHP native session wrapper

  • Saturday, June 3, 2017
  • by which1ispink
  • Repository
  • 1 Watchers
  • 2 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

which1ispink/session

This is a simple PHP native session wrapper, (*1)

Installation

If you're using composer it's as easy as requiring the package:, (*2)

$ composer require which1ispink/session

Otherwise you'd have to include the src/Session.php file the old-fashioned way., (*3)

Usage

use Which1ispink\Session\Session;

// this needs to be called in your bootstrapping code like an index.php file
Session::init();

// setting a session variable
Session::set('username', 'some_username');

// getting said variable later
Session::get('username');

// get all session contents
Session::all();

// or get all session contents including flash messages
Session::all(true);

// check if previous session variable exists (returns a boolean)
Session::has('username');

// or remove previous session variable
Session::remove('username');

// or go a step further and clear all session data
Session::clear();

Flash messages

You can use flash messages that only exist for the duration of next request, (*4)

// add a flash message
Session::addFlashMessage('status', 'Your order has been submitted successfully!');

// get previous flash message on the next request
Session::getFlashMessage('status');

// get all flash messages currently in the session
Session::getAllFlashMessages();

License

This library is licensed under the MIT license. See License File for more information., (*5)

The Versions

03/06 2017

dev-master

9999999-dev

A simple PHP native session wrapper

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Ahmed Hassan

php session

03/06 2017

dev-test

dev-test

A simple PHP native session wrapper

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Ahmed Hassan

php session

03/06 2017

1.1.0

1.1.0.0

A simple PHP native session wrapper

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Ahmed Hassan

php session

26/05 2017

1.0.0

1.0.0.0

A simple PHP native session wrapper

  Sources   Download

MIT

The Requires

  • php ^7.0

 

by Ahmed Hassan

php session