• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cookie getComment

 
Ed Lance
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you make the setComment and getComment work for cookies. Starting to wonder if it's a browser/server setting.

Browser is set to accept cookies and when I check the cookie on the client I can see it was added BUT I can't see the comment. So even though the cookie is added to the response for some reason the comment
doesn't persist.
Just to confirm...comment is null when I read it again.

Suggestions?

PS
Have to substitute "Kookies" for "Cookies" because of JavaRanch posting restriction. So to test this code change it back to "Cookies".
Thanks!
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Besides the Name and value, there is no gurantee that you can retrieve any other cookie values using "get".
 
Ed Lance
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bosun...btw, is this documented anywhere? I checked Sun and googled pretty extensively and came up with nada.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what RFC 2109 has to say about comments
Comment=comment
Optional. Because cookies can contain private information about a
user, the Cookie attribute allows an origin server to document its
intended use of a cookie. The user can inspect the information to
decide whether to initiate or continue a session with this cookie.

also
If a Set-Cookie response header includes a Comment attribute, the
user agent should store that information in a human-readable form
with the cookie and should display the comment text as part of a
cookie inspection user interface.

When the client sends cookie information to the server:
The syntax for the header is:

cookie = "Cookie:" cookie-version
1*((";" | ",") cookie-value)
cookie-value = NAME "=" VALUE [";" path] [";" domain]
cookie-version = "$Version" "=" value
NAME = attr
VALUE = value
path = "$Path" "=" value
domain = "$Domain" "=" value


so - no return of the comment in the request header according to RFC2109
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!