PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Session Handler Class   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Session Handler Class
Store and retrieve session values
Author: By
Last change: Apply fixes from StyleCI
Date: 5 years ago
Size: 509 bytes
 

Contents

Class file image Download
<?php

require_once 'classes/Session.php';

$sess = new Session();

$name = 'session';

$value = 'Hay i am php session';

/*
// Set/store value in session

$sess->SetValue([

    'name' => $name,

    'value' => $value,

]);

*/

/*
//deleting/unset the session

$sess->UnsetValue($name);

*/

//printing the session if set

echo $sess->GetValue($name);

echo
'<br>';

//checking the session is set or not

if ($sess->CheckStatus($name)) {
    echo
'session is set';
} else {
    echo
'session is not set';
}