Example #1
0
 public static void ClearUserCookie()
 {
     try
     {
         Globals.ClearFWCookie();
         Globals.ClearWXCookie();
         HttpCookie httpCookie = HttpContext.Current.Request.Cookies["Vshop-Member"];
         if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
         {
             httpCookie.Value   = null;
             httpCookie.Expires = DateTime.Now.AddYears(-1);
             HttpContext.Current.Response.Cookies.Set(httpCookie);
         }
         HttpCookie httpCookie2 = HttpContext.Current.Request.Cookies["Vshop-Member-Verify"];
         if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value))
         {
             httpCookie2.Value   = null;
             httpCookie2.Expires = DateTime.Now.AddYears(-1);
             HttpContext.Current.Response.Cookies.Set(httpCookie2);
         }
         Globals.ClearReferralIdCookie();
     }
     catch
     {
     }
     finally
     {
         HttpContext.Current.Session["userid"] = null;
         HttpContext.Current.Session[Globals.GetCurrentWXOpenIdCookieName()] = null;
     }
 }
Example #2
0
        public static void ClearWXCookie()
        {
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["wxfollow"];

            if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
            {
                httpCookie.Value   = null;
                httpCookie.Expires = DateTime.Now.AddYears(-1);
                HttpContext.Current.Response.Cookies.Set(httpCookie);
            }
            HttpCookie httpCookie2 = HttpContext.Current.Request.Cookies[Globals.GetCurrentWXOpenIdCookieName()];

            if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value))
            {
                httpCookie2.Value   = null;
                httpCookie2.Expires = DateTime.Now.AddYears(-1);
                HttpContext.Current.Response.Cookies.Set(httpCookie2);
            }
        }