Changeset 2991

Show
Ignore:
Timestamp:
07/07/2008 08:19:34 PM (5 months ago)
Author:
Shadowhand
Message:

Fixing a bug in cookie::delete() that wouldn't unset the $_COOKIE global when expiring a cookie.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/cookie.php

    r2660 r2991  
    7979        public static function delete($name, $path = NULL, $domain = NULL, $prefix = NULL) 
    8080        { 
     81                if ( ! isset($_COOKIE[$name])) 
     82                        return FALSE; 
     83 
     84                // Delete the cookie from globals 
     85                unset($_COOKIE[$name]); 
     86 
    8187                // Sets the cookie value to an empty string, and the expiration to 24 hours ago 
    82                 return cookie::set($name, '', -86400, $path, $domain, FALSE, FALSE, $prefix); 
     88                return cookie::set($name, '', -(60 * 60 * 24), $path, $domain, FALSE, FALSE); 
    8389        } 
    8490