Last active
June 8, 2019 02:57
-
-
Save envygeeks/6967127 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'action_dispatch/middleware/session/redis_store' | |
module ActionDispatch | |
module Session | |
class SignedRedisStore < ActionDispatch::Session::RedisStore | |
def load_session(env) | |
stale_session_check! do | |
get_session(env, | |
cookie_jar(env)[@key] | |
) | |
end | |
end | |
def set_cookie(env, session_id, cookie) | |
cookie_jar(env)[@key] = cookie | |
end | |
def cookie_jar(env) | |
ActionDispatch::Request.new(env). | |
cookie_jar.signed | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment