I'm having trouble expiring a cookie in php. here's my code:
<?php
setcookie('reitinvestor_user', 'null', time()-3600,'',$_SERVER['SERVER_NAME']);
setcookie('reitinvestor_pass', 'null', time()-3600,'',$_SERVER['SERVER_NAME']);
echo '<pre>'; print_r($_COOKIE); echo '</pre>';
exit;
?>
Everytime i hit refresh, I get this result:
Array
(
[_csuid] => 47dae7b6cd2d9e89
[reitinvestor_user] => john
[reitinvestor_pass] => 1f3870be274f6c49b3e31a0c6728957f
[PHPSESSID] => 6027e370abad115e35b54b0be76befc8
)
I can do a setcookie with different key values and also expire them. I just can't seem to do it for reitinvestor_user and reitinvestor_pass. What's wrong?