PHP's setcookie
function looks like this:
bool setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )
As you can see, domain
has no standard value, but the following parameters (httponly
and secure
) do.
I want both last parameters set to true, but without specifying a domain to bind the cookie to. Is that even possible? Sadly, PHP doesn't allow something like this:
setcookie('name', 'value', time()+60, '/', $secure=true, $httponly=true);
Also see this SO question with a similar problem. Obviously, I cannot change the setcookie
function.
EDIT
Setting the domain
parameter to ""
or null
does not work.