Hi!
Can anybody help me with this problem. I am working on
an aspx page that has a number of cookies that were
set on a previous page using javascript. My current
page allows the user to select a new building and to
change the value of the cookie. The problem is that
the cookie's value won't change if I use the existing
cookie's name. When I create a cookie with a new name
the values will be placed in the cookie but this isn't
useful since I use these cookies names throughout this
and other pages.
Here's the code.
HttpCookie bldg;
String bldgid;
bldg = new HttpCookie("bldg");
bldg.Value = bldgid; //new value selected by user
Response.Cookies.Add(bldg);
This code will not assign the new value to the
existing cookie it will retain its old value.
HttpCookie bl;
String bldgid;
bl = new HttpCookie("bl");
bl.Value = bldgid; //new value selected by user
Response.Cookies.Add(bl);
This code will assign the new value but I need to
refer to my cookie by the name of bldg.
Thanks for your help,
Elissa Setareh