PHP Classes

PHP Session Handler Class: Store and retrieve session values

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 309 All time: 7,330 This week: 660Up
Version License PHP version Categories
php-sessuib-handler- 1.0.2MIT/X Consortium ...5PHP 5, User Management
Description 

Author

This class can store and retrieve session values.

It implements the basic functions to manipulate values stored in regular PHP sessions. Currently it can:

1. Start a session if it was not started
2. Set a session value
3. Delete or unset session values
4. Check whether a session value is set or not
5. Retrieve a session value

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84411 in Pakistan Pakistan
Week rank: 280 Up6 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<?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';
}


Details

PHP Session Handler class

This class can store and retrieve session values.

It implements the basic functions to manipulate values stored in regular PHP sessions. Currently it can:

  1. Start a session if it was not started
  2. Set a session value
  3. Delete or unset session values
  4. Check whether a session value is set or not
  5. Retrieve a session value

  Files folder image Files  
File Role Description
Files folder imageclasses (1 file)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  classes  
File Role Description
  Plain text file Session.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:309
This week:0
All time:7,330
This week:660Up