Wednesday, May 2, 2012

Save username and password in cookies in asp.net

My web application's home page has a RememberMe checkbox.. If the user checks it, i ll store emailId and password in cookies.. My code is::::


if (this.ChkRememberme != null && this.ChkRememberme.Checked == true)
   
{
     
HttpCookie cookie = new HttpCookie(TxtUserName.Text, TxtPassword.Text);
     cookie
.Expires.AddYears(1);
     
Response.Cookies.Add(cookie);
   
}

No comments:

Post a Comment