instance method
write_session
Ruby on Rails 6.1.7.10
Since v5.2.8.1Signature
write_session(env, sid, session, options)
Set a session in the cache.
Parameters
-
envreq -
sidreq -
sessionreq -
optionsreq
Source
# File actionpack/lib/action_dispatch/middleware/session/cache_store.rb, line 31
def write_session(env, sid, session, options)
key = cache_key(sid.private_id)
if session
@cache.write(key, session, expires_in: options[:expire_after])
else
@cache.delete(key)
end
sid
end
Defined in actionpack/lib/action_dispatch/middleware/session/cache_store.rb line 31
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Session::CacheStore