try following code
if (chkRememberPassword.Checked == true)
{
Response.Cookies["UName"].Value = txtUName.Text;
Response.Cookies["PWD"].Value = txtPWD.Text;
Response.Cookies["UName"].Expires = DateTime.Now.AddMonths(2);
Response.Cookies["PWD"].Expires = DateTime.Now.AddMonths(2);
}
else
{
Response.Cookies["UName"].Expires = DateTime.Now.AddMonths(-1);
Response.Cookies["PWD"].Expires = DateTime.Now.AddMonths(-1);
}
Paste the following code snippet in page load
if (!IsPostBack)
{
if (Request.Cookies["UName"] != null)
txtUName.Text= Request.Cookies["UName"].Value;
if (Request.Cookies["PWD"] != null)
txtPWD.Text.Attributes.Add("value", Request.Cookies["PWD"].Value);
if (Request.Cookies["UName"] != null && Request.Cookies["PWD"] != null)
chkRememberPassword.Checked = true;
}