Wininet set_cookie must handle not only <name>=<value> but also <name> = <value>

Bruno Jesus 00cpxxx at
Thu Jul 21 22:53:51 CDT 2011

Hello, while running uTorrent 3 I see the following fixme several times:

fixme:wininet:set_cookie Unknown additional option L"expires =
Sat,23-Jul-2011 02:20:13 GMT"

After searching the source code I realized the expires parameter is
already implemented but wine finds the entry names only if there's no
space between the parameter name and the equal sign, here is a small
piece of wininet.c around line 440 and 470.

static const WCHAR szExpires[] = {'e','x','p','i','r','e','s','=',0}
else if (strncmpiW(ptr, szExpires, 8) == 0)

After searching msdn I found this article with an example that uses spaces:

bReturn = InternetSetCookie(TEXT(""), NULL,
           TEXT("TestData = Test; expires = Sat,01-Jan-2000 00:00:00 GMT"));

Looks like the cookie above is valid. I also found this other article
telling about the data format:

After reading parts of the cookies RFC I found this note:

   NOTE: The syntax above allows whitespace between the attribute and
   the = sign.

The newer version of the cookie rfc has the very same note:

Please, don't bother to answer if this was already noted and is to be
fixed. Also sorry for not pointing a solution. I'll study more on this
later but I can say in advance that windows xp sets the cookie
correctly when there is the space. I guess I'll start by adding tests
for this on the file tests/internet.c

Best wishes,

universe* god::bigbang (void); //and then it all began...

More information about the wine-devel mailing list