Closed Bug 668646 Opened 9 years ago Closed 9 years ago

Invalid cookie hosts causes sessionstore to stop updating


(Firefox :: Session Restore, defect)

Not set



Firefox 8
Tracking Status
firefox7 --- fixed


(Reporter: zpao, Assigned: zpao)



(Keywords: verified-aurora, verified-beta, Whiteboard: [qa!])


(1 file)

This is possibly the same cause as bug 601739, but it's a different error, so filing it separately.

Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsICookieManager2.getCookiesFromHost]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource:///components/nsSessionStore.js :: <TOP_LEVEL> :: line 2205"  data: no]
Source File: resource:///components/nsSessionStore.js
Line: 2205

1. Go to www..emacs (this happened to be how I repro'd)
2. Go anywhere

2 might not even be necessary.

I guess www..emacs is in session history and somehow being used to get hosts. That's not a real host, so cookie svc says no.

So I'm putting this up to 2 choices:
1. Fix our host regex
2. Just try-catch getCookiesFromHost, discarding bad hosts
Attached patch Patch v0.1Splinter Review
Took approach 2
Assignee: nobody → paul
Attachment #543272 - Flags: review?(dietrich)
I looked at replacing the regexp with getting the scheme & host from the nsIURI, but that doesn't actually help. will still give www..emacs and we'd need to try-catch anyway.

(I'm thinking it might be good to use nsIURI in _serializeHistoryEntry and grabbing scheme & host there instead of execing regexps a lot and then creating an nsIURI for most of those anyway... filed bug 668865)
Comment on attachment 543272 [details] [diff] [review]
Patch v0.1

Review of attachment 543272 [details] [diff] [review]:

if possible, would like to move the try/catch down closer to the bit that you know throws. r=me either way though.
Attachment #543272 - Flags: review?(dietrich) → review+
Moved the try-catch closer to failure.
Whiteboard: [fixed-in-fx-team]
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 8
Blocks: 671520
Is there any way this could make it into the beta branch (Firefox 7)?
Comment on attachment 543272 [details] [diff] [review]
Patch v0.1

approval-beta? Safe patch that just wraps a potential error that causes session restore to stop saving state.
Attachment #543272 - Flags: approval-mozilla-beta?
Attachment #543272 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
qa+ for verification in Firefox 7
Whiteboard: [qa+]
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:9.0a1) Gecko/20110922 Firefox/9.0a1
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a2) Gecko/20110914 Firefox/8.0a2
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0

Mozilla/5.0 (X11; Linux x86_64; rv:9.0a1) Gecko/20110922 Firefox/9.0a1
Mozilla/5.0 (X11; Linux x86_64; rv:8.0a2) Gecko/20110916 Firefox/8.0a2
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20100101 Firefox/7.0

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0a1) Gecko/20110922 Firefox/9.0a1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0a2) Gecko/20110921 Firefox/8.0a2
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) Gecko/20100101 Firefox/7.0

Verified on Win7/64bit, Ubuntu/64bit, Mac 10.6
1. Go to
2. Go to www..emacs
3. Open Error Console
Result: Error not displayed in error console.
Whiteboard: [qa+] → [qa!]
Verified as fixed also on XP:
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
You need to log in before you can comment on or make changes to this bug.