Skip to content

Instantly share code, notes, and snippets.

@sobstel
Last active January 24, 2020 18:36
Embed
What would you like to do?
Warden Rails cookie
Warden::Manager.after_authentication do |user, auth, _opts|
cookies = ActionDispatch::Request.new(auth.env).cookie_jar
cookies.encrypted[REMEMBER_ME_COOKIE_NAME] = { value: user.id, expires: 1.week.from_now }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment