See this simple example
//Write username to the cookie
Response.Cookies["PBLOGIN"]["UNAME"] = this.TbUserName.Text;
//Write password to the cookie
Response.Cookies["PBLOGIN"]["UPASS"] = this.TbPassword.Text;
//Create a cookie with expiry of 30 days
Response.Cookies["PBLOGIN"].Expires = DateTime.Now.AddDays(30);
Now next time when you want to chek wheather the cookie exist check it this way and assign new value the cookie variables:
if ((Request.Cookies["PBLOGIN"] != null))
{
Response.Cookies["PBLOGIN"]["UNAME"] = this.TbUserName.Text;
Response.Cookies["PBLOGIN"]["UPASS"] = this.TbPassword.Text;
}