This works fine on localhost, but the same code just won't update my live website cookie. Here's the code:
index.php
$lg->updateCookies($username, $hashSalt[0]);
updateCookies function:
$site = '.ciadacapa.com.br';
// ---------------------------------------------------
// Updates the cookies
// ---------------------------------------------------
function updateCookies($username, $hash){
setcookie('ciadacapaUser', '', time()-3600, '/', $this->site);
setcookie('ciadacapaHash', '', time()-3600, '/', $this->site);
setcookie('ciadacapaUser', $username, time()+3600*24*7, '/', $this->site);
setcookie('ciadacapaHash', $hash, time()+3600*24*7, '/', $this->site);
return true;
}
Although the class is receiving the correct values, the cookie just retains the old value it had and never updates. Any ideas on this?
Thanks in advance!