I am working in asp.net and c#.In my application i have login page for which i am having remember me feature.My code works well in firefox but not working in chrome and IE.please let me know where i went wrong..
CODE:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["Usermail"].Value != null && Request.Cookies["userpass"].Value != null)
{
txtemail.Text = Request.Cookies["Usermail"].Value;
txtpassword.Attributes["value"] = DecryptString(Request.Cookies["userpass"].Value);
}
}
}
protected void btnlogin_Click1(object sender, EventArgs e)
{
if (chkremember.Checked)
{
ck.Expires = tkt.Expiration;
Response.Cookies["userpass"].Value = EnryptString(txtpassword.Text);
Response.Cookies["Usermail"].Value = txtemail.Text;
Response.Cookies["Usermail"].Expires = DateTime.Now.AddDays(30);
Response.Cookies["userpass"].Expires = DateTime.Now.AddDays(30);
}
}
NOTE:Here EnryptString(); and DecryptString(); are methods for encrypting and decrypting the password..