Skip to content

Instantly share code, notes, and snippets.

View stellis's full-sized avatar

Steve Tellis stellis

View GitHub Profile
function session_exists()
{
if(php_sapi_name() === 'cli')
{
$exists = FALSE;
}
else if(version_compare(phpversion(), '5.4.0', '>='))
{
$exists = (session_status() === PHP_SESSION_ACTIVE);
}