title: Rails with Redis and Devise not working
body: <p>I've added <a href="https://github.com/redis/redis-rb" rel="nofollow noreferrer">redis-rb</a> to my rails 5 application in order to take care of backend processes managed by sidekiq.</p>
  
  <p>User auth in my app is managed by Devise.</p>
  
  <p>After getting all my workers etc. to function correctly, it seems that my session store is now broken. The problem is that when I sign out, the user session is not destroyed any longer, thus making it impossible to sign out. </p>
  
  <p>Here is my session_store.rb config:</p>
  
  <pre><code>if Rails.env.production?
    Rails.application.config.session_store :cookie_store, key: '_myapp_session', domain: ENV['SESSION_STORE_DOMAIN'], tld_length: ENV['TLD_LENGTH'].to_i
  else
    Rails.application.config.session_store :cookie_store, key: '_myapp_session', domain: :all, tld_length: 2
  end
  </code></pre>
  
  <p>I also tried to experiment with the <a href="https://github.com/roidrage/redis-session-store" rel="nofollow noreferrer">redis-session-store</a> gem after encountering this error but this leads to a InvalidAuthenticityToken error. </p>
  
  <p>I don't really want to change my session store to use redis though. Is there any way to solve this or am I missing something?</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>sessions_controller.rb (devise)</p>
  
  <pre><code>def destroy
      signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
      set_flash_message! :notice, :signed_out if signed_out
      yield if block_given?
      respond_to_on_destroy
  end
  </code></pre>