I'm trying to set a cookie on my Next.js app, it's working on local server and another remote server, but Firebase App Hosting is not adding properly the cookie at the moment of sending the response.
I've read this: Cookie is undefined in production NextJS getServerSideProps and I've change the name of my cookie as __session, but isn't working either.
Is there a specific way to achieve setting a cookie using Firebase App Hosting?
Recently another person have the same issue: https://groups.google.com/g/firebase-talk/c/WdynpnAkF3M?pli=1
you can open the cloud run instance, click on Integrations and add firebase hosting as an integration
this will give you a web.app domain, and you can also point your own domain when you go to firebase>hosting (not app hosting)
you'll also need to make sure that the cloud run allows for unauthenticated invocations (you can do it from the security tab)
this will allow your set-cookie header to work
there might also be some limitation when cookies are passed in a request, i know that __session will work for sure

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With