I had Login form ,and I added check box for remember me ,I did my code well but when I check rememeber me check box it rememeber only user name only.so please any one help me.
protected void CBRemeber_CheckedChanged(object sender, EventArgs e) { HttpCookie MyCookie = new HttpCookie("MyCookie"); bool IsRememberme = CBRemeber.Checked; if (IsRememberme) { MyCookie.Values.Add("UserName", TxtUser.Text); MyCookie.Values.Add("Password", TXTPassword.Text); MyCookie.Expires = DateTime.Now.AddDays(15); } else { MyCookie.Values.Add("UserName", string.Empty); MyCookie.Values.Add("Password", string.Empty); MyCookie.Expires = DateTime.Now.AddDays(5); } Response.Cookies.Add(MyCookie); }