Open Bug 1887118 Opened 3 months ago Updated 3 months ago

Network event cookies are missing all properties except name and value

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [webdriver:backlog])

The current network event cookies only contain name and value on Firefox.
They should be regular network.Cookie objects:

network.Cookie = {
    name: text,
    value: network.BytesValue,
    domain: text,
    path: text,
    size: js-uint,
    httpOnly: bool,
    secure: bool,
    sameSite: network.SameSite,
    ? expiry: js-uint,
    Extensible,
};

https://w3c.github.io/webdriver-bidi/#serialize-cookie

I think we discussed this limitation when we implemented the events, but I don't think we filed bugs or wrote tests about it.

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)

Hi Valentin,

Right now we parse the headers from the channel (using visitRequestHeaders) and when we spot the cookie header, we simply parse it to extract name and values of the cookies.

Do you know if there is any API which we could use to easily get full details about the cookies for a given request (eg samesite, issecure, etc...). Otherwise we would use various APIs from Services.cookies but I wanted to check first with you if there was a better approach.

Severity: -- → S3
Flags: needinfo?(hskupin) → needinfo?(valentin.gosu)
Priority: -- → P3
Whiteboard: [webdriver:backlog]

Currently cookies are added to the request this way:
HttpBaseChannel::AddCookiesToRequest -> GetCookieStringFromHttp -> GetCookiesForURI.

I'm thinking you could use getCookiesFromHost to get all the cookies - they might need to be sorted through to make sure we don't send the ones we don't have to, like GetCookiesForURI does.

Alternatively, you could create a XPIDL binding for ParseAttributes, and use that to parse the cookie header set on the request. I think that might be easier.

Flags: needinfo?(valentin.gosu)
You need to log in before you can comment on or make changes to this bug.