From 3413fe6bfd423d45d083ff4ed62c0f72c2cc272f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 28 May 2009 06:11:53 +0800 Subject: Rename 'kohana' to 'system' to conform to the Kohana filesystem layout. I'm comfortable with us not clearly drawing the distinction about the fact that it's Kohana. Signed-off-by: Gallery Role Account --- system/helpers/cookie.php | 84 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 system/helpers/cookie.php (limited to 'system/helpers/cookie.php') diff --git a/system/helpers/cookie.php b/system/helpers/cookie.php new file mode 100644 index 00000000..901b6d86 --- /dev/null +++ b/system/helpers/cookie.php @@ -0,0 +1,84 @@ +cookie($name, $default, $xss_clean); + } + + /** + * Nullify and unset a cookie. + * + * @param string cookie name + * @param string URL path + * @param string URL domain + * @return boolean + */ + public static function delete($name, $path = NULL, $domain = NULL) + { + if ( ! isset($_COOKIE[$name])) + return FALSE; + + // Delete the cookie from globals + unset($_COOKIE[$name]); + + // Sets the cookie value to an empty string, and the expiration to 24 hours ago + return cookie::set($name, '', -86400, $path, $domain, FALSE, FALSE); + } + +} // End cookie \ No newline at end of file -- cgit v1.2.3