You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SocketIOClientOption.cookies configuration option is sometimes ignored entirely, if any cookie exists in the HTTPCookieStorage.shared.cookies(for: url) for the installed Swift application.
if let cookies =HTTPCookieStorage.shared.cookies(for: url), !cookies.isEmpty {letheaders=HTTPCookie.requestHeaderFields(with: cookies)
for (key, val) in headers {
req.setValue(val, forHTTPHeaderField: key)}}
The code will overwrite whatever cookies are attempted to be set by this library. This caused a lot of confusion because when debugging an issue, it looked like down to the Engine.IO layer that the configured cookies were being set properly. But it was in the Starscream layer that they were ignored.
It doesn't look like there's a solution other than to document this behavior more clearly to avoid confusion and bugs in the future. Starscream doesn't look like it allows custom cookies if any HTTPCookieStorage cookies exist.
The text was updated successfully, but these errors were encountered:
The
SocketIOClientOption.cookies
configuration option is sometimes ignored entirely, if any cookie exists in theHTTPCookieStorage.shared.cookies(for: url)
for the installed Swift application.See https://github.com/daltoniam/Starscream/blob/4.0.4/Sources/Framer/HTTPHandler.swift#L70
The code will overwrite whatever cookies are attempted to be set by this library. This caused a lot of confusion because when debugging an issue, it looked like down to the Engine.IO layer that the configured cookies were being set properly. But it was in the Starscream layer that they were ignored.
It doesn't look like there's a solution other than to document this behavior more clearly to avoid confusion and bugs in the future. Starscream doesn't look like it allows custom cookies if any HTTPCookieStorage cookies exist.
The text was updated successfully, but these errors were encountered: