Instantly share code, notes, and snippets.

@sobstel /warden.rb
Last active Feb 20, 2018

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