File: sample.php

Recommend this page to a friend!
  Classes of teste  >  SessionManager  >  sample.php  >  Download  
File: sample.php
Role: Sample output
Content type: text/plain
Description: Learn to use SessionManager
Class: SessionManager
Manager class for easy session variable handling
Author: By
Last change: Grafia do comentário corrigida.
Date: 16 years ago
Size: 916 bytes



// Constructor call: $session = new SessionManager("path_for_session", client_ip, expiration_time)
//		path_for_session: local directory where the session files will be stored
//		client_ip: client ip used to handle session, you can use $REMOTE_ADDR.
//		expiration_time: the time in minutes that the session is going to be active. 
$sessao = new SessionManager("./",getenv("REMOTE_ADDR"),100);

// Create and start the session engine

// Store some variables in the session

// Load and print stored variables
print("exp1 = " . $sessao->getSessionVar("exp1") . "<br>");
print("exp2 = " . $sessao->getSessionVar("exp2") . "<br>");
print("exp3 = " . $sessao->getSessionVar("exp3") . "<br>");

For more information send a message to info at phpclasses dot org.