| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2008-11-21 15:53 UTC] jani@php.net
  [2008-11-21 23:10 UTC] simon at incarnis dot com
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 04:00:01 2025 UTC | 
Description: ------------ Cookie is created with an 8 hour expiry time, supplying only the name, value and expire parameters. Attempt to remove cookie using setcookie with the same name, a null value and an expire parameter of -1 hours. Cookie not removed. Supplying the (supposedly optional) path parameter set to "/" successfully removes the cookie. Reproduce code: --------------- setcookie("user", $_SESSION[user], mktime()+(60*60*8)); ... ... setcookie("user",NULL,mktime()-3600); Expected result: ---------------- Cookie should not exist. Actual result: -------------- Cookie does exist. Add a path parameter of "/" to the removal call and the cookie is removed.