hugri
hugri

Reputation: 1416

What's the ID of a cookie?

is it possible to have two cookies with the same

For example:

cookie #1

name=.ASPXAUTH
content: D06BB....
Host: www.mydomain.com
Path:/
Expires: 2-12-2015

cookie #2

name=.ASPXAUTH
content: 46458....
Host: www.mydomain.com
Path:/
Expires: 2-12-2016

So my question: if is technically possible to have both of these two cookies at the same time?

Upvotes: 0

Views: 301

Answers (1)

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120917

No, setting cookie #2 would overwrite cookie #1 since they have the same name.

If what you propose was indeed possible, it would be impossible to change the value of an existing cookie, because doing so would create a new cookie.

Multiple cookie name/value pairs can exist as long as the path is different (or the domain obviously). You can refer to RFC 2109 for more details.

Upvotes: 1

Related Questions