0
我在asp.net和c#中工作。在我的應用程序中,我有登錄頁面,我記住了我的功能。我的代碼在Firefox中運行良好,但不能在Chrome和IE中工作。請讓我知道我錯在哪裏..記住我不工作鉻和IE
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);
}
}
注意:這裏EnryptString();和DecryptString();是用於加密和解密密碼的方法..
你檢查你的瀏覽器設置(Chrome和IE)。記住Cookie的選項可能被禁用。 – 2013-02-11 13:55:37