How to setup cookie domain?
This is a container parameter now.

Put this in services.yml or another service definition YAML file:

parameters:
  session.storage.options:
    cookie_domain: '.domain.com'


Since it is in a yaml file, it can't easily be dynamic, one option you have is having multiple yml files, and you dynamically add the one for the right environment, or you have a services.local.yml, just like settings.local.php that you have on each environment and not in git.