PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Malik 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: adding comment to the class file
Date: 29 days ago
Size: 542 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";

}