PHP Classes

File: README.txt

Recommend this page to a friend!
  Classes of khamel  >  BPT_SessionManager  >  README.txt  >  Download  
File: README.txt
Role: Documentation
Content type: text/plain
Description: README
Class: BPT_SessionManager
Manage user access sessions
Author: By
Last change:
Date: 9 years ago
Size: 1,105 bytes


Class file image Download
*** Use case ***

Using this class is very simple, after you have included it, you have to call only

$smngr = SessionManager::get_instance();

to obtain a SessionManager instance and automatically start a new session. If you want to verify if session starts correctly you can use this method


You can manipulate registered variables using this method


to clear all variables, just call


*** Protection Mode ***

Protection mode is an easy way to ensure that some code run only after a condition is verified, for example a page that require a valid login. In this case, if user has submitted a valid login information you can use


Now, in all pages that require a valid login, call


to verify the condition. you can pass a url (e.g. "") as parameter to is_protected() function if you want to force url redirection in case of test fail.