1. Go to this page and download the library: Download phossa2/session library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phossa2 / session example snippets
use Phossa2\Session\Session;
use Phossa2\Session\Carton;
// start a 'global' session
$sessGlobal = new Session('global');
// set 'global' session as the default
Carton::setDefaultSession($sessGlobal);
// start another 'private' session at the same time
$sessPrivate = new Session('private');
// a box using default session 'global'
$boxGlobal = new Carton();
// global counter
++$boxGlobal['counter'];
// another box named 'toy' using the private session
$boxPrivate = new Carton('toy', $sessPrivate);
// private counter
++$boxPrivate['counter'];
// use a cookie named 'one'
$sessOne = new Session('one');
// use a cookie named 'two'
$sessTwo = new Session('two');