public static function del($key, $type = null) { if (!isset($type)) { $type = LuS::$_type; } if ($type == 1) { // $_SESSION $_SESSION[$key] = ''; unset($_SESSION[$key]); return true; } elseif ($type == 2) { //$_SESSION mysql $LuSS = new LuSessionSql(); return $LuSS->del($key); } elseif ($type == 3) { //$_SESSION file $LuSF = new LuSessionFile(); return $LuSF->del($key); } elseif ($type == 4) { //$_COOKIE return LuCookie::del($key); } return false; }
<?php //注册一个自动加载类函数(在类调用前注册,否则可能会报一个致命错误,而导致程序退出) spl_autoload_register(array("Lu", "findClass")); //加载controller文件夹下的类 Lu::$_controllers = (include ROOT_PATH . 'config/' . "controller.config.php"); //加载model文件夹下的类 Lu::$_models = (include ROOT_PATH . 'config/' . "model.config.php"); //加载libs/plugins里面的类(如果开启了自动按需加载) if (OPEN_AUTO_LOAD_PLUGINS === true) { Lu::$_plugins = array("image", "mailer", "qq", "upload", "weibo", "weixin", "wuliu", "xs"); } //初始化设置cookie LuCookie::initCookie();
protected function _mpLogin($email, $username) { $mp = isset($_POST['mp']) ? htmlspecialchars(trim($_POST['mp'])) : ''; if ($mp == 'on') { LuCookie::setCookie("is_login", array("username" => $username)); } return true; }