public static function startSession($domain, $expire = 360000) { response::noCache(false); ini_set("session.gc_maxlifetime", $expire); session_set_cookie_params($expire, '/', $domain); if (!session_start()) { throw new Exception('session can\'t start'); } // Reset the expiration time upon page load if (isset($_COOKIE[session_name()])) { setcookie(session_name(), $_COOKIE[session_name()], time() + $expire, "/", $domain); } //echo 'Session start'; }