static function init($sid = null) { if (self::$objSession != null) { if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } session_destroy(); } self::$objSession = new Session(); session_set_save_handler(array(&self::$objSession, "open"), array(&self::$objSession, "close"), array(&self::$objSession, "read"), array(&self::$objSession, "write"), array(&self::$objSession, "destroy"), array(&self::$objSession, "gc")); session_set_cookie_params(SESSION_EXPIRE); if (isset($sid)) { session_id($sid); } session_start(); $_SESSION['running'] = "true"; }