How to check cookies HTTPOnly
and secure
attribute?
I have an issue with cookies not containing the HTTPOnly
and secure
attribute.
So I use this code to solve it.
<?php
$name_cookie = '1';
$value_cookie = '2';
$expirationTime_cookie = 0; // Session cookie.
$path_cookie = '/';
$domain_cookie = 'example.com';
$isSecure_cookie = true;
$isHttpOnly_cookie = true;
setcookie($name_cookie, $value_cookie, $expirationTime_cookie, $path_cookie, $domain_cookie, $isSecure_cookie, $isHttpOnly_cookie);
?>
I want to know, if I use the above code, will the issue with cookies not containing the HTTPOnly
and secure
attributes, be solved or not?