Closed Bug 404296 Opened 17 years ago Closed 8 years ago

new features for the nsICookieService, nsICookie interfaces and cookie-rejected notifications

Categories

(Core :: Networking: Cookies, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: linuxed7, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

I think the following features would greatly enhance Firefox and provide a much easier way for extension developers to retrieve information from cookie notifications.

nsICookieService
Add a new method named formatCookieString() that will accept a cookie header string obtained from nsIHttpChannel.getResponseHeader("Set-Cookie") and return a nsICookie object.  There is currently no easy way to create a nsICookie object from a string.  I've had to create a custom xpcom component to do this job and I'm sure that other ext dev's would appreciate this feature as well.

nsICookie or nsICookie2
Add a new property named uri that will contain the uri that sent the cookie.  Add a new property named originalURI that will contain the uri of the webpage that the cookie belongs to.  By having access to both of those properties it would be incredibly easy to compare the two specs to determine if the cookie is from a 3rd party site.  Those properties would also help with sending cookie-changed and cookie-rejected notifications.

cookie-rejected notifications
Send a nsICookie object instead of a nsIURI.  If a uri property is added to the nsICookie interface then the cookie-rejected uri could still be obtained.  It is not currently possible to access any information relating to the rejected cookie other than the url that sent it. (nsIURI.spec)  By sending a nsICookie object for both cookie-changed and cookie-rejected notifications all of the cookie information (host,name,value,expires) will be accessible in addition to the uri of the cookie.

Reproducible: Always
-> core
Component: Preferences → Networking: Cookies
OS: Windows XP → All
Product: Firefox → Core
QA Contact: preferences → networking.cookies
Hardware: PC → All
Version: unspecified → Trunk
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.