```ruby
# frozen_string_literal: true

unless Rails.env.test?
  Rails.application.config.session_store(
    :cookie_store,
    key: Settings.site.session_key,
    domain: %W[.#{Settings.site.default_domain} #{Settings.site.default_domain}],
    secure: Rails.env.production?
  )
end
```

Fix cookie store in locahost domain cannot login
user
```ruby
# frozen_string_literal: true

unless Rails.env.test?
  Rails.application.config.session_store(
    :cookie_store,
    key: Settings.site.session_key,
    domain: Rails.env.production? ? %W[.#{Settings.site.default_domain} #{Settings.site.default_domain}] : nil,
    secure: Rails.env.production?
  )
end
```
assistant