I can set a normal cookie, like only set name, value and expires. But I can't set it into secure cookie or httpOnly cookie or both.
Here is my code:
<?php
setcookie("TestCookie", "CookieValue", 0, null, null, true, true);
if(isset($_COOKIE["TestCookie"])){
echo '$_COOKIE["TestCookie"] = '.$_COOKIE['TestCookie'];
session_id($_COOKIE["TestCookie"]);
}
else
echo "Sorry! Cookie TestCookie was not set.";
?>
I have searched in search engine. Try every way. Such as changing a setting in php.ini etc.
It showed no error but it still doesn't work. Please answer on my question.