Moved setCookie() test into <head>