Cookie using @SetHTTPHeader

I used to use @SetHTTPHeader to set a stored cookie using a domain=domain.com. We are now running the db on a different server, and this is no longer working. I have to use www.domain.com instead of domain.com. Does anyone know why that is. It will not create the cookie otherwise.