Skip to content

Instantly share code, notes, and snippets.

View ardalis's full-sized avatar
💭
Building up my YouTube channel - follow me there!

Steve Smith ardalis

💭
Building up my YouTube channel - follow me there!
View GitHub Profile
@ardalis
ardalis / gist:1628720
Created January 17, 2012 20:34
What's wrong with this?
if (ChkRemeberMe.Checked)
{
var hcEmail = new HttpCookie("AcmeEmail", Convert.ToString(TxtUserName.Text.Trim()));
var hcPassword = new HttpCookie("AcmePassword", Convert.ToString(TxtPassword.Text.Trim()));
hcEmail.Expires = DateTime.Now.AddDays(30);
hcPassword.Expires = DateTime.Now.AddDays(30);
Response.Cookies.Add(hcEmail);
Response.Cookies.Add(hcPassword);
}