Put domain: all at the end of the line in config / session_store.rb
eg.
YourApp::Application.config.session_store :encrypted_cookie_store, key: '_yourapp_session', domain: :all
You may also need to change this setting in config / environment / production.rb
config.action_dispatch.tld_length = 2
If your domain is example.com , then your tld_length (top-level domain length) is 1 (which is the default value). example.com.au is 2, 127.0.0.1.xip.io is 5, etc.
source share