205
seCure sessIon storAge
//Better and Faster than using shared/tmp files on shared server
const CLEAR = 0;
//high level of encryption protection for temporary data, pretty fast
const ENCRYPT_IV_PER_TABLE = 1;
// highest level of encryption protection available per individual
record
const ENCRYPT_IV_PER_RECORD = 2;
//this value is used in read/write switch statement
// change level to CLEAR, ENCRYPT_IV_PER_TABLE, ENCRYPT_IV_PER_
RECORD
const ENCRYPT_LEVEL = ENCRYPT_IV_PER_RECORD;
public function _construct($host, $db, $user, $pass)
{
try{
$this->db = new PDO("mysql:host = {$host};dbname = { $db};charset
= utf8",
$user,
$pass);
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$t his->db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, ...