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
ERRO[0000] Uncaught (in promise) GoError:
cannot recognize cookie values:
could not convert array element [object Object] to []network.CookieParam at 0:
could not convert struct value 10 to *cdp.TimeSinceEpoch for field Expires:
could not convert 10 to cdp.TimeSinceEpoch
Suggestion
The current addCookies API accepts an internal cookie object: cdproto.network.Cookie. This object contains superfluous information and can be dangerous because it lets users set internal CDP details from their scripts. We can use api.Cookie instead of cdproto.network.Cookie to be consistent with our BrowserContext.cookies API. And also prevent possible security problems.
inancgumus
changed the title
Cannot add cookies with an expiration
Fix expiration property while adding cookies
Sep 7, 2023
inancgumus
changed the title
Fix expiration property while adding cookies
Fails to set expiration property while adding cookies
Sep 19, 2023
inancgumus
changed the title
Fails to set expiration property while adding cookies
Cookies: Setting the expiration property fails while adding cookies
Sep 19, 2023
There is a problem while converting the
expires
property (in seconds) tocdproto
'scdp.TimeSinceEpoch
.expires
property.cdproto
require setting an exact date (time since epoch).cdproto
while it expects us atime.Time
for setting an expiration date for cookies.xk6-browser version
v1.0.2
Steps to reproduce the problem
Add a cookie with an expiration property (in seconds).
Expected behaviour
Cookies should be added with an expiration date.
Actual behaviour
Suggestion
The current
addCookies
API accepts an internal cookie object:cdproto.network.Cookie
. This object contains superfluous information and can be dangerous because it lets users set internal CDP details from their scripts. We can useapi.Cookie
instead ofcdproto.network.Cookie
to be consistent with ourBrowserContext.cookies
API. And also prevent possible security problems.Updates: #6
The text was updated successfully, but these errors were encountered: