Cookies lost when reverse proxy

Hi there,

I am using a reverse proxy with this toml

[[redirects]]
from = “/"
to = “https://bubbleurl.com/:splat”
status = 200
force = true
headers = {Access-Control-Allow-Origin= "”}

It works great. Only it isnt passing the cookies (i thing because of a domain mismatch). How can I fix this?

Is there a way to change the cookie domain using the proxy?

Can I hire someone to fix this?

I’m no expert, but, the answer is probably no. The domain name of setting cookies can only be decided while setting them. You can’t ‘move’ them later. However, if configured correctly, they can be read by other websites. See here for more details: https://stackoverflow.com/questions/3342140/cross-domain-cookies

Also, I’m not 100% sure if I’ve understood your question completely, but, maybe, if you have the cookie value before hand, you can set cookies using headers like this: https://www.geeksforgeeks.org/http-headers-set-cookie/

1 Like

You cannot set cookies for another site as that would open up a ton of security issues. However, if you have access to the bubbleurl site (you run it) then you can add this functionality to handle a query string and set a cookie being passed to it.

1 Like

Hi guys,

I tried adding the following:

[[redirects]]
from = “/"
to = “https://test.saasworksuite.com/:splat
status = 200
force = true
headers = {Access-Control-Allow-Origin= "
”, Access-Control-Allow-Credentials= “true”, Access-Control-Allow-Methods= “GET, POST”, Access-Control-Allow-Headers= “Content-Type, *”}

But then the status 200 fails to work. I have no access to the bubble code (as its a no code platform). But I though since the request is passed thru netlify I should be able to modify or remove something inside the header before passing it down to the client.

Is there nothing like that?

Sadly, I don’t know anything more in this regard. However, if I may ask, what exactly do you want to achieve by passing on the cookies? If there are some other workarounds, maybe someone can suggest that.