Correctly gets domain for cookie