I am trying to validate a xero webhook for Invoice create and update. here is my code:
$body=file_get_contents('php://input');
$yourHash = base64_encode(hash_hmac('sha256',$body,'gDgLpn+xqX7ojhCEq5xx1viAyy6nEa4CMuiQxcXf9ctAoLkscnh/b1Y3002JjIEHOvOEt3MBvx1VLHh6lzaiAA==',true));
if ($yourHash == $_SERVER['HTTP_X_XERO_SIGNATURE'])
{
header("status: 200 Ok");
}else
{
header("status: 401 Unauthorized");
}
The error here is "Response contained a cookie". How I can remove this cookie in response?