First commit

This commit is contained in:
Frédéric Guillot
2014-01-25 14:56:02 -05:00
commit 9383a15af6
80 changed files with 7519 additions and 0 deletions

34
lib/session.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
class Session
{
const SESSION_LIFETIME = 2678400;
public function open($base_path = '/')
{
session_set_cookie_params(
self::SESSION_LIFETIME,
$base_path,
null,
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on',
true
);
session_start();
}
public function close()
{
session_destroy();
}
public function flash($message)
{
$_SESSION['flash_message'] = $message;
}
public function flashError($message)
{
$_SESSION['flash_error_message'] = $message;
}
}