ring

dangercoder 2019-11-04T18:28:58.023Z

Hi, Is it possible to set a cookie on redirect? I have a "/callback"-route which I want to redirect to "/" and set an cookie. I have wrapped my routes with the wrap-cookies middleware. I return this from my callback-route as a response but it does not work. (Redirect works but not cookie).

{:status 302, :headers {"Location" "/"}, :body "", :cookies {:t {:value "1337"}}}

seancorfield 2019-11-04T18:55:08.023900Z

@jarvinenemil This is not something that all HTTP clients will honor, even if you can get Ring to do it, so I'd be wary of relying on it.

seancorfield 2019-11-04T18:57:42.025300Z

It used to be that some popular browsers ignored cookies on a redirect response. Chromium had a long-standing bug report about this and marked it WontFix / Permanent Bug.

dangercoder 2019-11-04T18:58:45.026300Z

Yeah I found the Chromium bug as well. I'll come up with a different strategy