I am trying to store the value AFRSUSERNAME=v@r.com&AFRSPASSWORD=%&v~lyHYNrTCcQq6 into Cookies["AFRSSTATION"]. The value is saved successfully and i can see it using browser. Problem in accessing the values. When i try to get the value of returningUser["AFRSUSERNAME"] i got v@r.com and value of returningUser["AFRSPASSWORD"] is %. It looks like internal function spliting the value on the bases of & sign. My question is how can i save the & sign in Cookie. Given bellow is related code
HttpCookie returningUser = null;
if (HttpContext.Current.Request.Cookies["AFRSSTATION"] != null)
{
returningUser = HttpContext.Current.Request.Cookies["AFRSSTATION"];
if (returningUser["AFRSUSERNAME"] != null &&
returningUser["AFRSUSERNAME"] != "" &&
returningUser["AFRSPASSWORD"] != null &&
returningUser["AFRSPASSWORD"] != "")
{
UserName = returningUser["AFRSUSERNAME"];
Password = returningUser["AFRSPASSWORD"];