Skip to content

Instantly share code, notes, and snippets.

@stevepolitodesign
Created February 25, 2022 20:46
Show Gist options
  • Save stevepolitodesign/1d400ad8c56ffe43b81edfeb7c707b73 to your computer and use it in GitHub Desktop.
Save stevepolitodesign/1d400ad8c56ffe43b81edfeb7c707b73 to your computer and use it in GitHub Desktop.
ActionDispatch::Cookies httponly option

Before

def remember(active_session)
  cookies.permanent.encrypted[:remember_token] = active_session.remember_token
end

After

def remember(active_session)
  cookies.permanent.encrypted[:remember_token] = { value: active_session.remember_token, httponly: true }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment