Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Problem with Cookies and Keys

  Asked By: Jose    Date: Apr 04    Category: Asp.net    Views: 957
  

We're starting to port some ASP applications to ASP.NET and we're
facing a problem with cookies :

In Classic ASP you could do this :

response.cookies("mycookie")("keyone")="Value one"
response.cookies("mycookie")("keytwo")="Value two"


Later on other ASP page you could just update one of the keys like
this :

response.cookies("mycookie")("keytwo")="New Value"

And then request each key from the cookie and you'll get both "Value
one" for "keyone" and "New Value" for "keytwo"

However, we've noticed that In ASP.NET if you update only one of the
keys the others are lost!

If you first do :

response.cookies("mycookie")("keyone")="Value one"
response.cookies("mycookie")("keytwo")="Value two"


And then in another ASP.NET script, you attempt to update one like
this :

response.cookies("mycookie")("keytwo")="New Value"

Then the value for key "keyone" is lost!
It's like if updating any key will overwrite and delete any other key

Is this a bug or are we missing something?
Please help it's been a real pain.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Problem with Cookies and Keys Or get search suggestion and latest updates.




Tagged: