I'm sending the following response in clojure ring:
(res/set-cookie
(res/redirect (env :some-url))
"some-id"
(->
req
foo-ns/bar
:id
)
{:max-age (* 30 24 60 60 1000) :path "/"})
And on printing this response I get:
{:status 302, :headers {"Location" "<http://localhost:5000>"}, :body "", :cookies {"some-id" {:value "1341313515135490454", :max-age 2592000000, :path "/"}}}
But on the client side, the cookie isn't set, which I can see in the console. What am I doing wrong?@pshar10 I'm pretty sure you cannot reliably set cookies on a redirect response. It's not supported by all browsers.
The point is that the req is coming from google oauth, and after the request arrives I want to redirect the user to some route, while setting a cookie that they are logged in. So how can I do both if one cannot set cookies in a redirect?