In 0.11.4 the following change was introduced:
3ee0426
I'm seeing this exception raised in Rack v2.2.3.1:
NoMethodError:
undefined method `cookie_value' for "e1af07cec3cbb9aade2800550652e7bc":String
This can be traced to this line:
https://github.com/rack/rack/blob/925a4a6599ab26b4f3455b525393fe155d443655/lib/rack/session/abstract/id.rb#L482-L484
It seems that the data returned by set_session is a simple string, but a different data structure is expected:
|
def set_session(env, sid, session_data, options = nil) |
|
expiry = get_expiry(env, options) |
|
if expiry |
|
redis.setex(prefixed(sid), expiry, encode(session_data)) |
|
else |
|
redis.set(prefixed(sid), encode(session_data)) |
|
end |
|
sid |
|
rescue Errno::ECONNREFUSED, Redis::CannotConnectError => e |
|
on_redis_down.call(e, env, sid) if on_redis_down |
|
false |
|
end |
|
alias write_session set_session |
If you dig into ActionDispatch::Session::CookieStore we can see that it's write_session implementation return a Rack::Session::SessionId instance (albeit decorated):
https://github.com/rails/rails/blob/04972d9b9ef60796dc8f0917817b5392d61fcf09/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb#L104-L107
If one returns an appropriately crafted instance this package works again.
In 0.11.4 the following change was introduced:
3ee0426
I'm seeing this exception raised in Rack v2.2.3.1:
This can be traced to this line:
https://github.com/rack/rack/blob/925a4a6599ab26b4f3455b525393fe155d443655/lib/rack/session/abstract/id.rb#L482-L484
It seems that the data returned by
set_sessionis a simple string, but a different data structure is expected:redis-session-store/lib/redis-session-store.rb
Lines 127 to 139 in e9a7d80
If you dig into ActionDispatch::Session::CookieStore we can see that it's
write_sessionimplementation return a Rack::Session::SessionId instance (albeit decorated):https://github.com/rails/rails/blob/04972d9b9ef60796dc8f0917817b5392d61fcf09/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb#L104-L107
If one returns an appropriately crafted instance this package works again.