Added a check to see if the server was set, otherwise don't add a cookie