How to use Action Cable with Devise

The websocket server is running in a separate process from the Rails application so to authenticate the user we need cookies. Set up cookies in Devise # app/config/initializers/warden_hooks.rb Warden::Manager.after_set_user do |user,auth,opts| scope = opts[:scope] auth.cookies.signed["#{scope}.id"] = user.id auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now end # app/config/initializers/warden_hooks.rb ... Warden::Manager.before_logout do |user, auth, opts| scope = opts[:scope] auth.cookies.signed["#{scope}.id"] = nil auth.cookies.signed["#{scope}.expires_at"] = nil end ... Configure AC connection # Read More