PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Antoine Aflalo   My Session Manager   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: how to use the class
Class: My Session Manager
Manipulate session variables with encrypted values
Author: By
Last change:
Date: 13 years ago
Size: 550 bytes
 

Contents

Class file image Download
<?php
require_once 'SessionManager.class.php';
//Creating the SessionManager object
$sess=SessionManager::getInstance("MySession");
//adding a variable to the session
$sess->myvar="test";

//get the var
$sess->myvar;

//check if the var is set
if(isset($sess->myvar))
    echo
"yatta";

//regen an ID with deleting the old one
$sess->regenerateID(true);

//delete the session and the session cookie.
$sess->destroy();

//Imagine that's an another page just do
$sess=SessionManager::getInstance();
//to get the SessionManager, with all the config.
?>