<?php
setcookie("name", "abc");
echo $_COOKIE["name"];
?>
When I reload this page, it shows nothing on the screen. Why?
But reload again, abc is shown.
WHY??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you set a cookie, it is not available until the next page load.
This is very clearly laid out in the documentation, which you should read.
and