0 ? time()+(86400*$expiryDays) : 0; setcookie($name, $value, $expiry, Director::baseURL()); $_COOKIE[$name] = $value; } else { if(Director::isDev()) 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 ); } } } ?>