Login   Register  
PHP Classes
elePHPant
Icontem

File: file_sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vagharshak Tozalakyan  >  Private Sessions  >  file_sample.php  >  Download  
File: file_sample.php
Role: Example script
Content type: text/plain
Description: Sample
Class: Private Sessions
Store sessions in a private directory or database
Author: By
Last change:
Date: 2006-02-05 08:44
Size: 524 bytes
 

Contents

Class file image Download
<?php

  
// Include the class source.
  
require_once 'private_sessions.class.php';

  
// Create an object.
  
$ps = new private_sessions();

  
// Store session data in disk files.
  
$ps->save_to_db false;

  
// The path of the directory used to save session data. No trailing slashes.
  
$ps->save_path realpath('.') . '/ps_sess_tmp';

  
// Set up session handlers.
  
$ps->set_handler();

  
// That's all! Proceed to use sessions normally.
  
session_start();
  echo 
$_SESSION['foo'] = 'Hi there!';

?>