I'm trying to set a cookie in my controller quick is equal to a POST param value. I've tried cookies[:email] = params[:email]
. When a user does a POST to this controller the params[:email]
is present. When the page renders after this however, the cookie isn't visible.
Other dummy cookies I've set are also not visible, and Only visible when I soft refresh the page. If I empty the cache and Do a hard reload no cookie is visible. If I just hit enter in the browser URL again, the cookie is present, however the email param has been lost, so that cookie isn't set.
Can anyone clarify what I'm missing? I read one SO post saying to do a redirect back to this page, however that isn't working for me either.