...

View Full Version : delete cookie using foreach



zodehala
08-23-2009, 01:49 AM
i can delete all cookie using


foreach($_COOKIE as $c => $d){
setcookie($c,"",time()-3600);

}

but i can not delete following cookie i created previously.

(second one is automatically created )



127_0_0_1 : 1250981744
PHPSESSID : 4eabf513497f6762077d2150b1ae7bf5

mlseim
08-23-2009, 02:38 AM
Are you confusing cookies with PHP sessions?
Sessions are automatically deleted when the user closes their browser (session).

funnymoney
08-23-2009, 08:28 AM
to delete sessions you need to add this line of code



<?php

unset($_SESSION);
session_destroy();

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum