Bug 111584 - [soup] session cookies are not correctly reported in getRawCookies()
Summary: [soup] session cookies are not correctly reported in getRawCookies()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://developer.gnome.org/libsoup/2...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 08:20 PST by Chris Dumez
Modified: 2013-03-06 09:27 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.44 KB, patch)
2013-03-06 08:26 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2013-03-06 08:20:34 PST
As per libsoup documentation, SoupCookie->expires is NULL for session cookies. However, the soup implementation for getRawCookies() does not check for NULL case before passing the value to soup_date_to_time_t(). This leads to the following warnings:

(process:27280): libsoup-CRITICAL **: soup_date_to_time_t: assertion `date != NULL' failed

We should also pass true for WebCore::Cookie's session argument if SoupCookie->expires is NULL. The current implementation reports the cookie as a session one if soup_cookie_jar_is_persistent(jar) returns true, which is inaccurate. Note that this does not currently affect Web Inspector as it ignores the session member in CookieParser.js WebInspector.Cookies.buildCookieProtocolObject().

Instead, Web Inspector currently uses the following rule:

session: function()
    {
        // RFC 2965 suggests using Discard attribute to mark session cookies, but this does not seem to be widely used.
        // Check for absence of explicitly max-age or expiry date instead.
        return !("expires" in this._attributes || "max-age" in this._attributes);
    },
Comment 1 Sergio Villar Senin 2013-03-06 08:25:18 PST
Yeah I planned to fix that some time ago but I end up forgetting about it.
Comment 2 Chris Dumez 2013-03-06 08:26:55 PST
Created attachment 191757 [details]
Patch
Comment 3 WebKit Review Bot 2013-03-06 09:27:31 PST
Comment on attachment 191757 [details]
Patch

Clearing flags on attachment: 191757

Committed r144936: <http://trac.webkit.org/changeset/144936>
Comment 4 WebKit Review Bot 2013-03-06 09:27:35 PST
All reviewed patches have been landed.  Closing bug.