Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Cookies, Cookies

views
     
TSStraike
post Mar 28 2017, 12:54 PM, updated 7y ago

Getting Started
**
Junior Member
97 posts

Joined: Dec 2010
CODE
HttpCookie myCookie = new HttpCookie("myCookie ");
myCookie.Values["UserEmail"] = Session["user"].ToString();
myCookie.Values["ProductName"] = product_name;
myCookie.Values["ProductQuantity"] = quantityTxtBox.Text;
myCookie.Values["TotalPrice"] = totalPrice.ToString();

myCookie .Expires = DateTime.Now.AddHours(1);

Response.Cookies.Add(myCookie);


Hi guys, I have this chunk of code that adds cookies with values, such as UserEmail, ProductName, ProductQuantity and TotalPrice. How do I append a new cookie to the existing cookie without deleting the old ones? Please advise, thanks!
manjacat
post Mar 28 2017, 07:00 PM

New Member
*
Junior Member
32 posts

Joined: Dec 2013


myCookie.Values["NewCookieNme"] = "New String Value" does not work?

i forgot already, but I think last time thats how I add new cookie
TSStraike
post Mar 30 2017, 10:27 AM

Getting Started
**
Junior Member
97 posts

Joined: Dec 2010
QUOTE(manjacat @ Mar 28 2017, 07:00 PM)
myCookie.Values["NewCookieNme"] = "New String Value" does not work?

i forgot already, but I think last time thats how I add new cookie
*
This works, but I want to try to add new cookie to an existing cookie.

 

Change to:
| Lo-Fi Version
0.0108sec    0.27    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 02:49 AM