0 ? time()+(86400*$expiry) : $expiry; $path = ($path) ? $path : Director::baseURL(); setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly); } else { if(self::$report_errors) { user_error("Cookie '$name' can't be set. The site started outputting content at line $line in $file", E_USER_WARNING); } } } /** * Get a cookie variable */ public static function get($name) { return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; } public static function forceExpiry($name, $path = null, $domain = null) { if(!headers_sent($file, $line)) { self::set($name, null, -20, $path, $domain); } } public static function set_report_errors($reportErrors) { self::$report_errors = $reportErrors; } public static function report_errors() { return self::$report_errors; } }