based on this (https://curl.haxx.se/rfc/cookie_spec.html) the domain should contain at least 2 dots so the answer is to use other alias for localhost to simulate my subdomains. Something like: *.example.com
After changing the domain all worked as anticipated.