I found another very simple solution: the class wrapper around the PHP function setcookie, which is so simple, it does not need to be tested for unity:
class Cookiesetter {
public function setcookie($name, $value = "", $expire = 0, $path = "",
$domain = "", $secure = false, $httponly = false) {
return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
}
}
Then the method setcookiecan be ridiculed. This has the added benefit that I can implement other methods, such as expireCookie.
source
share