Archived Forum Post

Index of archived forum posts

Question:

http.SetRequestHeader("Cookie", char *) bug?: value in name/value pair gets enclosed in double quotes

Sep 02 '12 at 08:01

Using 9.31 On Mac OS.

Calling http.SetRequestHeader("Cookie", cookie.c_str());

where cookie.c_str() is name1=KszB2jqHO7phNhxcJlxIabDpHDR9;name2=abcdefgh

Enabled session log: What I see is:

Cookie:name1=KszB2jqHO7phNhxcJlxIabDpHDR9;name2="abcdefgh"

That is, after the first semi-colon (;), the value (in this case abcdefgh is enclosed in double quotes). If I have 3 name value pairs, the last 2 show this behavior. I get a server error.

Now, when I call

  CkString tmp_str;

  http.GetRequestHeader("Cookie", tmp_str);

  printf("GetRequestHeader %s\n", tmp_str.getString());

I get the correct value.

Appreciate your help. Thanks.

Note: the spec says that comma (,) should work (as ; is for backwards compatibility). When I use comma, the session log file shows the correct Cookie header but it doesn't work. It is possible that the server doesn't support this.

Babu Srinivasan


Answer

Babu,

Thanks, this may already be fixed in the internal pre-release. I will re-build for Mac OS, test, and then notify you with a download link when the fix is ready. (I expect this to be later today.)

-Matt


Answer

This new build should fix the problem:

(if using Objective-C) http://www.chilkatsoft.com/preRelease/Chilkat-9.3.1-Cocoa-10.6.zip

(if using C/C++) http://www.chilkatsoft.com/preRelease/chilkat-9.3.1-macosx.tar.gz

-Matt