0 ? time()+(86400*$expiryDays) : 0; $path = ($path) ? $path : Director::baseURL(); // Versions of PHP prior to 5.2 do not support the $httpOnly value if(version_compare(phpversion(), 5.2, '<')) { setcookie($name, $value, $expiry, $path, $domain, $secure); } else { 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 was content at line $line in $file", E_USER_WARNING); } } /** * Get a cookie variable */ static function get($name) { return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; } static function forceExpiry( $name ) { if(!headers_sent($file, $line)) { setcookie( $name, null, time() - 86400 ); } } static function set_report_errors($reportErrors) { self::$report_errors = $reportErrors; } static function report_errors() { return self::$report_errors; } } ?>