Cookies and RFC 2109

  • Thread starter Thread starter mauro
  • Start date Start date
M

mauro

it does not seem that the HttpCookie class is in compliance with the rfc
2109, it does not expose the optional comment attribute, even asp.net 2.0
beta 2 has this problem and frankly speaking I do not understand why a new
version of the framework that pretends to stay runinng for years until a new
version, has to be not compliant with standards when the java platform
already supports such standard.
 
You can get and set the comment through the HttpCookie indexer:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Values["Comment"] = "myCookie purpose";
String purpose = myCookie.Values["Comment"];

Compliance!
 
Scott Allen said:
You can get and set the comment through the HttpCookie indexer:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Values["Comment"] = "myCookie purpose";
String purpose = myCookie.Values["Comment"];

Compliance!

Thanks, I didn't know we could use the indexer to access the attributes.
 
this just adds a value pair named Comment, doesn't really add the attribute.

you should open a bug on the beta 2 newgroup - although it may be too late
to add this feature.

http://lab.msdn.microsoft.com/productfeedback/

-- bruce (sqlwork.com)




Scott Allen said:
You can get and set the comment through the HttpCookie indexer:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Values["Comment"] = "myCookie purpose";
String purpose = myCookie.Values["Comment"];

Compliance!

--
Scott
http://www.OdeToCode.com/blogs/scott/

it does not seem that the HttpCookie class is in compliance with the rfc
2109, it does not expose the optional comment attribute, even asp.net 2.0
beta 2 has this problem and frankly speaking I do not understand why a new
version of the framework that pretends to stay runinng for years until a
new
version, has to be not compliant with standards when the java platform
already supports such standard.
 
Scott said:
You can get and set the comment through the HttpCookie indexer:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Values["Comment"] = "myCookie purpose";
String purpose = myCookie.Values["Comment"];

Compliance!

Um... no. Adding a value like that will concatenate it to the existing
value string with an ampersand, just like form data. RFC 2965 (2109 is
obsolete) prescribes a semicolon.

But more importantly, ASP.NET only uses the Set-Cookie header, not
Set-Cookie2, which is the correct way to set RFC 2965 cookies. Thus,
only Netscape (Version 0) cookies are currently supported.

Cheers,
 
Thanks, Joerg. I apolozgize for the misinformation.

--
Scott
http://www.OdeToCode.com/blogs/scott/

Scott said:
You can get and set the comment through the HttpCookie indexer:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Values["Comment"] = "myCookie purpose";
String purpose = myCookie.Values["Comment"];

Compliance!

Um... no. Adding a value like that will concatenate it to the existing
value string with an ampersand, just like form data. RFC 2965 (2109 is
obsolete) prescribes a semicolon.

But more importantly, ASP.NET only uses the Set-Cookie header, not
Set-Cookie2, which is the correct way to set RFC 2965 cookies. Thus,
only Netscape (Version 0) cookies are currently supported.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top