2017 © Pedro Peláez
 

library session

PHP's native session wrapper with namespacing

image

okneloper/session

PHP's native session wrapper with namespacing

  • Wednesday, April 20, 2016
  • by okneloper
  • Repository
  • 1 Watchers
  • 1 Stars
  • 355 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

PHP's native session wrapper with namespacing

<?php

use Okneloper\Session\Session;

// optional
Session::setDefaultNamespace('My Namespace');

// Start the session if necessay and Iniitialize a session object
$session = Session::newInstance();

$session->username = 'admin';
$session->foo = array('bar', 'baz');

print_r($_SESSION);
Array
(
    [My Namespace] => Array
        (
            [username] => admin
            [foo] => Array
                (
                    [0] => bar
                    [1] => baz
                )

        )

)
$session1 = Session::newInstance('admin');

$session1->username = 'johndoe';
$session1->role = 'manager';

$session2 = Session::newInstance('profile');

$session2->username = 'the_master';
$session2->timestamp = time();

print_r($_SESSION);
Array
(
    [admin] => Array
        (
            [username] => johndoe
            [role] => manager
        )

    [profile] => Array
        (
            [username] => the_master
            [timestamp] => 1455371559
        )

)

The Versions

20/04 2016

dev-master

9999999-dev https://github.com/okneloper/session

PHP's native session wrapper with namespacing

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Aleksey Lavrinenko

session

20/04 2016

v0.1.1

0.1.1.0 https://github.com/okneloper/session

PHP's native session wrapper with namespacing

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Aleksey Lavrinenko

session

13/02 2016

v0.1.0

0.1.0.0 https://github.com/okneloper/session

PHP's native session wrapper with namespacing

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Aleksey Lavrinenko

session