PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
yes this is standard cookie behavior. the cookie will only be noticed on the next time they goto the page or any other page on your server. what you can do it
this will make the $_COOKIE['CINTRA'] available to be used as a variable like that anywhere on the page but the cookie won't really be there until a page refresh, you are just kind of faking it until then.
you are right shiznatix, the cookie is not available until a page refresh happens. But I am thinking why is it happening, is it because it takes more time to create a cookie and by the time you read the next line to access cookie it is not created or being created....
cookies are stored client-side, not server side. Thus the page request has to complete, so the output headers can be sent to the client (cookies are set as part of the headers, iirc)
the $_COOKIE super global is formed and defined from the page request sent by the user agent. Because of this, this means the $_COOKIE super global is defined before anything else happens in your PHP script. So setcookie() has no bearing on it until the next page request.