because on the 404 the cookie is a response header from the apache server. The correct url is handled by another server which doesnt know that it needs to set that cookie there.