This is my code for my setting of cookie in javascript and reading of cookie in php.
jsglobalset.html:
<script>
var values = "poppy"
document.cookie = "textout=" + values + "; path=/";
</script>
phpglobalread.php:
<?php
$messsage = $_COOKIE["textout"];
if($message != "") { echo $message; }
else { echo "Fail to read."; }
?>
output of phpglobalread.html:
Fail to read.
I tried reading the cookie in javascript and it works, but I can't read in php. Any ideas? Thanks.