Trellis + Multisite problem with cookies

Hi,

I am trying to use Trellis with a subdomain Multisite install. I’ve done everything according to the docs. But when I create a new site I can’t log in. Getting an error that cookies are not enabled. I’ve played around with different site url and home url variables - nothing helps. The main site login works fine. What else can I check?

Best regards,
Anton

Show us the contents of your configuration files that prove that

Ok. No problem.

wordless_sites.yml:

wordpress_sites:
  dev:
    site_hosts:
      - canonical: dev
        redirects:
          - www.dev
    local_path: ../dev # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: a.vanyukov@testor.ru
    multisite:
      enabled: true
      subdomains: true
    env:
      domain_current_site: dev
      wp_home: http://dev
      wp_siteurl: http://dev/wp
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false

config/application.php added:

/* Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true); // Set to false if using subdirectories
define('DOMAIN_CURRENT_SITE', env('DOMAIN_CURRENT_SITE'));
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Vagranfile added:

PRIVATE_IP = '192.168.50.5'

and this instead of the hostmanager part:

  if Vagrant.has_plugin? 'landrush'
    config.landrush.enabled = true
    config.landrush.tld = config.vm.hostname

    hostnames.each do |host|
      config.landrush.host host, PRIVATE_IP
    end
  else
    fail_with_message "vagrant-hostmanager missing, please install the plugin with this command:\nvagrant plugin install vagrant-hostmanager"
  end

I was having this problem a bunch also, but added

define('COOKIE_DOMAIN', '');

to config/environments/[environment].php if you are using bedrock. It seemed to solve the problem 99% of the time.

If I do that, I can’t even open the WordPress page. Get an error:

The constant "COOKIE_DOMAIN" is defined (probably in wp-config.php). Please remove or comment out that define() line.

UPDATE: after vagrant suspend && vagrant up, the error disappeared and I can now login. COOKIE_DOMAIN is defined as suggested by colinob1. Thank you!