Reputation: 13
i have this command line in php for set a cookie.
document.cookie="<?php echo $_POST["setcookie"]; ?>"+"domain=.adidas.it;path=/";
I want to add 10 minutes expired time, who can help me? thanks
Upvotes: 0
Views: 4163
Reputation: 1879
There is a PHP function to set a cookie
setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )
In your case
$name = "yourname";
$value = "yourvalue";
$expire = time() + (60*10);
$domain = ".adidas.it";
$path = "/";
setcookie($name,$value,$expire,$path,$domain);
Upvotes: 1