Bug 97471 - Web Inspector: Cookie info in Network Resources Cookies tab shows "Invalid Date"
Summary: Web Inspector: Cookie info in Network Resources Cookies tab shows "Invalid Date"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 11:39 PDT by otcheung
Modified: 2012-11-02 01:53 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.28 KB, patch)
2012-09-24 11:45 PDT, otcheung
no flags Details | Formatted Diff | Diff
Patch (19.62 KB, patch)
2012-11-01 07:11 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (19.64 KB, patch)
2012-11-01 09:17 PDT, Vsevolod Vlasov
pfeldman: review+
pfeldman: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description otcheung 2012-09-24 11:39:32 PDT
Cookietable.js is trying to create a new date object using another date object returned from CookieParser's cookie.expires method. This causes an "Invalid Date" error to show up when we view the cookie table under network resources.
Comment 1 otcheung 2012-09-24 11:45:21 PDT
Created attachment 165417 [details]
Patch
Comment 2 WebKit Review Bot 2012-09-25 07:06:50 PDT
Comment on attachment 165417 [details]
Patch

Clearing flags on attachment: 165417

Committed r129502: <http://trac.webkit.org/changeset/129502>
Comment 3 WebKit Review Bot 2012-09-25 07:06:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Yury Semikhatsky 2012-09-26 06:16:56 PDT
Committed r129628: <http://trac.webkit.org/changeset/129628>
Comment 5 Yury Semikhatsky 2012-09-26 06:19:17 PDT
Reopening since the changed was rolled out in http://trac.webkit.org/changeset/129628 as it caused an exception in WebInspector.CookiesTable._createGridNode:

Uncaught TypeError: Property 'expires' of object #<Object> is not a function CookiesTable.js:205
WebInspector.CookiesTable._createGridNode CookiesTable.js:205
WebInspector.CookiesTable._populateNode CookiesTable.js:138
WebInspector.CookiesTable._rebuildTable CookiesTable.js:121
WebInspector.CookiesTable.setCookies CookiesTable.js:92
WebInspector.CookieItemsView._updateWithCookies CookieItemsView.js:93
mycallback CookieItemsView.js:216
InspectorBackendClass.dispatch InspectorBackend.js:186


cookie object in the failing method comes from protocol and doesn't have 'expires' method.
Comment 6 otcheung 2012-09-26 08:29:01 PDT
Yury, what site did you visit to reproduce this issue?
Comment 7 Vsevolod Vlasov 2012-11-01 06:55:10 PDT
(In reply to comment #6)
> Yury, what site did you visit to reproduce this issue?

This was actually not the particular site issue but the problem with the presentation of cookies in the resources panel. The reason was that the cookies that are loaded via protocol form back-end are stored in different format and this ambiguity causes weird behavior.

I am gonna reuse this bug to upload a complex patch (partly based on yours) that fixes overall problem.
Comment 8 Vsevolod Vlasov 2012-11-01 07:11:51 PDT
Created attachment 171838 [details]
Patch
Comment 9 Vsevolod Vlasov 2012-11-01 09:17:40 PDT
Created attachment 171870 [details]
Patch
Comment 10 Pavel Feldman 2012-11-01 09:36:19 PDT
Comment on attachment 171870 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171870&action=review

> Source/WebCore/inspector/front-end/CookieParser.js:259
> +    get expires()

Please always use functions.
Comment 11 Vsevolod Vlasov 2012-11-02 01:53:25 PDT
Committed r133273: <http://trac.webkit.org/changeset/133273>