Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with rack session in sinatra #67

Closed
matthewford opened this issue Aug 16, 2021 · 1 comment
Closed

Issue with rack session in sinatra #67

matthewford opened this issue Aug 16, 2021 · 1 comment

Comments

@matthewford
Copy link

Unexpected error while processing request: undefined method `private_id' for #<String:0x0000557f81ac6150>
 Did you mean?  private_methods
/usr/local/bundle/gems/redis-rack-2.1.3/lib/rack/session/redis.rb:49:in `block (2 levels) in write_session'

rack (2.2.3), redis-rack 2.1.3, redis-store 1.9.0, sinatra 2.1.0

Any ideas why that method is failing?

@tubbo
Copy link
Contributor

tubbo commented Aug 16, 2021

This usually happens when you migrate to a newer version of Rack, which changed the Session API to include both private and public IDs. The data in your Redis DB is still using String IDs, but the code is written to support Rack::Session::ID. Clearing out your sessions in Redis should resolve the issue, since new writes will be in the correct format.

@tubbo tubbo closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants