Ive had a similar problem but was able to delete the session cookie with:
setcookie ("PHPSESSID", "", time() - 3600, "/");
When I had the domain set the cookie was not deleted.
Hello
Change
var $allowed = $row["company_id"];
To
var $allowed[] = $row["company_id"];
At the moment $allowed is just a variable that you are overwriting in the loop adding [] turns $allowed into array adding $row['company_id'] to the next key value, 1,2 etc.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.