Cookies not working in Workers playground



I just tried the A/B Testing recipe provided at
and it seems like cookies don’t work in the playground?

I only changed this:

- url.pathname = `/${group}${url.pathname}`
+ url.pathname = `${url.pathname}?${name}=${group}`

And made some requests to
but it’s like the Set-Cookie never happens… the only thing in the cookie is __cfduid

Anyone has an idea why this is happening?

Cloudflare Workers Beta Feedback

@dan42 Hello! Cookies are not meant to work on the playground. Have you tried setting the cookie from an actual Cloudflare Worker?


@irtefa Ok, I tried creating a real Worker, but when I tried to add an “On” route I got “An unknown error occurred.” (with url

Note that adding an “Off” route works.


Hi @dan42! What route did you want to set “On” for? If you get the same error it would be awesome if you could share a screenshot of the error from the developer console.


Here’s the error I described:


Hi @dan42! Thanks for your patience. This should be fixed now. Can you please try creating a route?


@irtefa Indeed it works now.

Also I’ve confirmed that cookies work as expected when a worker is active in production.

BUT cookies do not work within the script editor. Maybe that’s as expected but it definitely makes testing harder. And it comes as somewhat of a surprise since it’s not mentioned anywhere in the docs.


@dan42 noted. Thanks! We will add this information to the docs!