The following code correctly identifies a properly formed payload and sends a 200 response.
if($signature == $authKey)
{
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach($cookies as $cookie) {
$parts = explode('=', $cookie);
$name = trim($parts[0]);
setcookie($name, '', time()-1000);
setcookie($name, '', time()-1000, '/');
}
}
http_response_code(200);
XeroWebHookHandler::handlePayload($rawPayload);
}
The endpoint however, won't accept a HTTP response containing a cookie.
The above code is giving me the following response Response contained a cookie
.
My service is hosted on an AWS EC2 instance running a standard Ubuntu server hosting apache.
What methods can I use to correctly identify what might be setting a HTTP_COOKIE
variable. Alternatively, am I clearing it correctly?