GNOME Bugzilla – Bug 602389
Function soup_cookies_from_request() causes failure of assertion (domain != NULL)
Last modified: 2009-11-21 14:55:07 UTC
Hi, When I use function soup_cookies_from_request() to get cookies from request message headers, I've got such warnings in my stderr: libsoup-WARNING **: (soup-cookie.c:443):soup_cookie_new: runtime check failed: (domain != NULL) I think this is because client sends to server only cookie's name and value without information about cookie expiration, domain and path and because this, function soup_cookies_from_request() calls soup_cookie_new() to create new cookie descriptor with NULL for path, domain and zero for expiration. And such calling prints warning to stderr. And I think denying of empty domain is not totally correct. I don't know theory of cookies very well, but there is some difficulties to use cookies with localhost. Localhost domain is not correct for cookies, and I could solve this problem by creating Set-Cookie header myself, where I do not set a domain property at all. Maybe it would be better to remove domain assertion from soup_cookie_new() and when programmer applies cookies to response (i.e. by calling soup_cookies_to_response()) for NULL-domained cookies a 'domain' property wouldn't send? This should solve the both problems I wrote about. Thanks and sorry for my English
fixed in git. will be in libsoup 2.28.2 in a few weeks. thanks for the bug report