Added @ to setcookie() to ensure headers already sent errors are generated