<?php
require_once 'Globals.php';
require_once 'Session.php';
$session = Session::getInstance();
//writing a data
$session->write('User.Permission.View', 1);
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
$data = $session->read('User');
echo "<pre>";
print_r($data);
echo "</pre>";
//Seching for data in array
if($session->search(1,'User.Permission')){
echo "<br> 1 Found ";
}
else{
echo "<br> 1 not found ";
}
//Checking if index exists
if($session->exists('Auth.User')){
echo "<br> User authenticated ";
}
else{
echo "<br> User not authenticated ";
}
//Destrying all data
$session->destroyAll();
?>
|