I have a Rails 4 ecommerce application and I use Devise to authenticate users.
I also use ActiveAdmin, which also uses Devise to authenticate it.
The problem I am facing is that I go out at any time. It looks like the session is crashing, but the session cookie remains the same. I tried to remove the Devise parameter skip_session_storage, but not the cube.
I store sessions in memcached using :dalli_store.
My devise.rb looks like this:
Devise.setup do |config|
config.secret_key = '<secret_key>'
config.mailer_sender = 'noreply@example.com'
config.mailer = 'Store::UserMailer'
require 'devise/orm/active_record'
config.case_insensitive_keys = [ :email ]
config.strip_whitespace_keys = [ :email ]
config.http_authenticatable_on_xhr = false
config.clean_up_csrf_token_on_authentication = true
config.stretches = Rails.env.test? ? 1 : 10
config.pepper = '<pepper_value>'
config.reconfirmable = false
config.password_length = 8..128
config.unlock_keys = [ :email ]
config.unlock_strategy = :both
config.maximum_attempts = 20
config.reset_password_within = 6.hours
config.token_authentication_key = :auth_token
config.scoped_views = false
config.sign_out_all_scopes = false
config.navigational_formats = ['*/*', :json, :html]
DeviseController.respond_to :html, :json
config.sign_out_via = :delete
config.warden do |manager|
manager.failure_app = ::FailureApp
end
end
And User.rb:
module Store
class User < DataModels::User
devise :confirmable, :rememberable, :async, :database_authenticatable, :registerable,
:recoverable, :validatable
validates :firstname,
:lastname,
presence: true,
allow_blank: false,
allow_nil: false
belongs_to :group, touch: true
belongs_to :shipping, class_name: "Address"
belongs_to :billing, class_name: "Address"
has_many :sales, as: :saleable
has_many :orders
end
end
Any pointers? I spent all day searching and searching the source code for Devise and Warden, but to no avail.