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

Add example how to configure Rails cookies store only for sidekiq web #5451

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/sidekiq/web/csrf_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def session(env)

https://guides.rubyonrails.org/api_app.html#using-session-middlewares

# example config sidekiq specific session
# https://github.com/mperham/sidekiq/wiki/Monitoring#rails-api-application-session-configuration
Sidekiq::Web.use ActionDispatch::Cookies
Sidekiq::Web.use ActionDispatch::Session::CookieStore, key: "_interslice_session"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is _interslice_session? Where does this code go?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


If this is a bare Rack app, use a session middleware before Sidekiq::Web:

# first, use IRB to create a shared secret key for sessions and commit it
Expand Down