Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cookies and RFC 2109

Reply
Thread Tools

Cookies and RFC 2109

 
 
mauro
Guest
Posts: n/a
 
      07-18-2005
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.


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      07-18-2005
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/

On Mon, 18 Jul 2005 14:48:51 GMT, "mauro" <(E-Mail Removed)>
wrote:

>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.
>


 
Reply With Quote
 
 
 
 
mauro
Guest
Posts: n/a
 
      07-18-2005

"Scott Allen" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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


Thanks, I didn't know we could use the indexer to access the attributes.


 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      07-18-2005
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" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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/
>
> On Mon, 18 Jul 2005 14:48:51 GMT, "mauro" <(E-Mail Removed)>
> wrote:
>
>>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.
>>

>



 
Reply With Quote
 
Joerg Jooss
Guest
Posts: n/a
 
      07-18-2005
Scott Allen wrote:

> 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,
--
http://www.joergjooss.de
(E-Mail Removed)
 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      07-19-2005
Thanks, Joerg. I apolozgize for the misinformation.

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

On Mon, 18 Jul 2005 14:09:03 -0700, "Joerg Jooss"
<(E-Mail Removed)> wrote:

>Scott Allen wrote:
>
>> 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,


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
an XML-based format with semantics like RFC 5322 (RFC 822)? Ivan Shmakov XML 3 02-13-2012 04:26 PM
Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies? _Who ASP .Net 7 09-18-2008 07:49 PM
RFC 2965 cookies, cookielib, and mailman. John J Lee Python 0 01-30-2005 10:19 PM
RFC 2965 cookies, cookielib, and mailman. C. Titus Brown Python 0 12-27-2004 08:41 PM
Encryption and RFC 2109 Archie Java 3 02-19-2004 05:10 PM



Advertisments