コード例 #1
0
        protected void lnkLogout_Click(object sender, EventArgs e)
        {
            string getCookie = ManageCookie.Cookies_Get("Username");

            if (!string.IsNullOrWhiteSpace(getCookie))
            {
                bool b = Autheticate.LogoutUser(getCookie);
                if (b)
                {
                    ManageCookie.Cookies_Set("Username", "", DateTime.Now.AddDays(-1));
                    Response.Redirect("Login.aspx");
                }
            }
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (flag && !Page.IsPostBack)
     {
         string getCookie = ManageCookie.Cookies_Get("Username");
         if (!string.IsNullOrWhiteSpace(getCookie))
         {
             bool b = Autheticate.IsUserLoggedIn(getCookie);
             if (!b)
             {
                 flag = true;
                 Response.Redirect("Login.aspx");
             }
         }
         //else
         //Response.Redirect("Login.aspx");
     }
 }