Browser refuses to save a cookie

spent whole day figuring out why does browser refuses to save cookie (both nextjs client and nestjs server are hosted there ). then, found domain .fly.io in public suffix list, it means that browser won’t allow you to set cookies for this domain.
Guys, do you have same problem?? if yes how do you handle it??

1 Like

Hi,

Well as of now, I’m seeing fly.dev not fly.io. But regardless, that makes sense. It would be a problem if you could set a cookie for fly.dev. As it’s shared by all Fly apps. But e.g just because com is in that list, doesn’t mean you can’t set a cookie for some-domain-you-do-own.com.

You can set a cookie from a Fly app. It just has to be for a domain you control (well, the one your app alone uses). Not one shared by others. If you are having a problem setting a cookie, check the domain and path (and other settings, like secure) exactly match.

2 Likes


here is a domain.
Ye, you are totally right, thanks for responding :slight_smile:

1 Like