PHP Classes

File: file_sample.php

Recommend this page to a friend!
  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: 17 years ago
Size: 524 bytes


Class file image Download

// 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.

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