miniflux-legacy/vendor/PicoFarad/Session.php
2014-02-08 14:13:14 -05:00

39 lines
587 B
PHP

<?php
namespace PicoFarad\Session;
const SESSION_LIFETIME = 2678400;
function open($base_path = '/', $save_path = '')
{
if ($save_path !== '') session_save_path($save_path);
session_set_cookie_params(
SESSION_LIFETIME,
$base_path,
null,
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on',
true
);
session_start();
}
function close()
{
session_destroy();
}
function flash($message)
{
$_SESSION['flash_message'] = $message;
}
function flash_error($message)
{
$_SESSION['flash_error_message'] = $message;
}