- time: documentation ( source)
- setcookie: documentation ( source)
<?php
setcookie(
'test-php8',
'value-php8',
time()+3600,
httponly: true
); // только для php8
setcookie(
'test-php7',
'value-php7',
time()+3600,
'', '', false,
true
);
setcookie(
'test-arr',
'val-arr',
['expires'=>time()+3600, 'httponly'=> true]
);