Пример #1
0
        /// <summary>
        /// 清空我的登录信息
        /// </summary>
        public static void ClearUserInfo()
        {
            //清空 session
            SessionHelper.WriteSession(KEY_S_UserName, null);
            SessionHelper.WriteSession(KEY_S_Uid, null);

            //清空cookie
            CookiesHelper.ClearCookies(KEY_C_UserName);
            CookiesHelper.ClearCookies(KEY_C_Uid);
            CookiesHelper.ClearCookies(KEY_C_UserInfo);
            CookiesHelper.ClearCookies(KEY_C_LOGID);
        }
Пример #2
0
        /// <summary>
        /// 管理员退出登录,清除信息
        /// </summary>
        public static void ClearInfo()
        {
            //写入 session
            SessionHelper.WriteSession(sessionAdminIDKey, null);
            SessionHelper.WriteSession(sessionAdminNameKey, null);
            SessionHelper.WriteSession(sessionAdminPowerKey, null);
            SessionHelper.WriteSession(sessionIsSupperAdminKey, null);
            SessionHelper.WriteSession(sessionAdminLogIDKey, null);

            //写入cookie
            CookiesHelper.ClearCookies(cookiesAdminIDKey);
            CookiesHelper.ClearCookies(cookiesAdminNameKey);
            CookiesHelper.ClearCookies(cookiesAdminInfoKey);
            CookiesHelper.ClearCookies(sessionAdminLogIDKey);
        }