class Rails::Application::Configuration

def session_store(new_session_store = nil, **options)

config.session_store :my_custom_store
# use ActionDispatch::Session::MyCustomStore as the session store

the +ActionDispatch::Session+ namespace:
If a custom store is specified as a symbol, it will be resolved to

config.session_options # => {key: "_your_app_session"}
config.session_store :cookie_store, key: "_your_app_session"

Additional options will be set as +session_options+:

+:disabled+. +:disabled+ tells Rails not to deal with sessions.
are +:cookie_store+, +:mem_cache_store+, a custom store, or
Specifies what class to use to store the session. Possible values
def session_store(new_session_store = nil, **options)
  if new_session_store
    if new_session_store == :active_record_store
      begin
        ActionDispatch::Session::ActiveRecordStore
      rescue NameError
        raise "`ActiveRecord::SessionStore` is extracted out of Rails into a gem. " \
          "Please add `activerecord-session_store` to your Gemfile to use it."
      end
    end
    @session_store = new_session_store
    @session_options = options || {}
  else
    case @session_store
    when :disabled
      nil
    when :active_record_store
      ActionDispatch::Session::ActiveRecordStore
    when Symbol
      ActionDispatch::Session.const_get(@session_store.to_s.camelize)
    else
      @session_store
    end
  end
end