Redirect based on cookies absence

Hello,

I see the docs here that state you can redirect based on cookies:

Cookie-based redirects allow you to send visitors content based on whether a specific HTTP cookie exists in the request or not

Is there a way to redirect if a cookie does not exist? Basically, if a cookie is absent redirect, otherwise go through.

Thanks!

Tom

Hi @tfmertz,

Unfortunately not at the moment. But you could set a different cookie that would redirect elsewhere and add another cookie, which if present, it won’t redirect as such. You could do it using the 200 rewrite.

Ok thanks for the pointers, hrishikesh.

Do you know if the new Edge Handlers could do something like detect a cookie’s presence and redirect based on that? It seems like they might give more access to the web request / response.

Hi @tfmertz,

Yes, they could do that. But that would have you waiting till the feature gets released to a public beta.

At the moment the testing list is closed, but if you request access, you would join the waiting list and could get a chance if someone leaves.

Ah figures, thanks for the reply, was hoping I could keep it on netlify, but sounds like we’ll have to switch to a dumbed down apache server until Edge Handlers go public.

Thanks for your time, I’ll mark the solution.