public static string WapLoginState(string userName) { string result = "0"; if (userName == null || userName.Length <= 0) { WebHint.ShowError("登录超时,请重新登录", "/Wap/wapuser/login.aspx", true, "Error"); result = "1"; } return(result); }
public static Cms.Model.C_admin GetLoginState(string id) { Cms.Model.C_admin model = null; if (id == null || id.Length <= 0) { WebHint.ShowError("登录超时,请重新登录", "/admin/login.aspx", true, "Error"); } else { model = new Cms.BLL.C_admin().GetModel(Convert.ToInt32(id)); } return(model); }
public static void LoginOut() { //HttpContext.Current.Session["user_id"] = null; //HttpContext.Current.Session.Remove("user_id"); //HttpContext.Current.Session.Clear(); HttpCookie cookie = (HttpCookie)HttpContext.Current.Request.Cookies["user"]; if (cookie == null) { cookie = new HttpCookie("user"); } cookie.Value = ""; cookie.Expires = DateTime.Now.AddMinutes(-14400); HttpContext.Current.Response.AppendCookie(cookie); Utils.WriteCookie("user", "DBE", -14400); Utils.WriteCookie("user", "DBE", -14400); WebHint.ShowError("登录超时,请重新登录", "/shop/login.aspx", true, "Error"); }
public static Cms.Model.C_user GetuserLoginState(string user_id) { Cms.Model.C_user model = null; if (user_id == null || user_id.Length <= 0) { WebHint.ShowError("登录超时,请重新登录", "/m/mine.aspx", true, "Error"); } else { if (new Cms.BLL.C_user().Exists(Convert.ToInt32(user_id))) { model = new Cms.BLL.C_user().GetModel(Convert.ToInt32(user_id)); } else { WebHint.ShowError("登录超时,请重新登录", "/m/mine.aspx", true, "Error"); } } return(model); }