Closed Dream-wu closed 3 months ago
I don't see any calls to addCookies
. Are you trying to set storage state to manually created json? Note that the value you set is expected to have been obtained via BrowserContext.storageState()
rather than manually crafted. Can you share complete self contained project that demonstrates the problem?
Yeah, the problem is that you try to manually create the storage state and has incompatible value for the same site attribute (LAX vs Lax). Even though you may get some luck with that, the format is considered an implementation detail and you should create it via BrowserContext.storageState(). You can create a context, add a bunch of cookies and then export them to a string using that method instead of manually calling Gson. That way you'll get storage state in correct format.
Yeah, the problem is that you try to manually create the storage state and has incompatible value for the same site attribute (LAX vs Lax). Even though you may get some luck with that, the format is considered an implementation detail and you should create it via BrowserContext.storageState(). You can create a context, add a bunch of cookies and then export them to a string using that method instead of manually calling Gson. That way you'll get storage state in correct format.
now, I am using new APIRequest.NewContextOptions()
not BrowserContext
Yeah, the problem is that you try to manually create the storage state and has incompatible value for the same site attribute (LAX vs Lax). Even though you may get some luck with that, the format is considered an implementation detail and you should create it via BrowserContext.storageState(). You can create a context, add a bunch of cookies and then export them to a string using that method instead of manually calling Gson. That way you'll get storage state in correct format.
now, I am using new APIRequest.NewContextOptions()
not BrowserContext
Version
1.41.0
Steps to reproduce
for example:
Expected behavior
I am attempting to use the setSameSite method to set the SameSite attribute for cookies, but I am experiencing issues where the value is not being set as expected.
Actual behavior
Additional context
The two values do not match
Environment