Manual:$wgCookieDomain

Details
Set to set an explicit domain on the login cookies. eg, "justthis.domain.org" or ".any.subdomain.net"