Jump to content

Archived

This topic is now archived and is closed to further replies.

matfish

Cookie Problem (dont slap me...)

Recommended Posts

Hi,

Iv set the cookies, but it takes a cache refresh (manual F5) of the browser in order for it to take affect and show the result on the same page.

Anything else I should be doing?

Thanks

Share this post


Link to post
Share on other sites
Try adding theses headers to your pages where cookie data is used:

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">

Share this post


Link to post
Share on other sites
what you will need to do is set the cookie array like below

$value="Cookie text";
$_COOKIE['cookie'] = $value;

set the cookie as normal using setcookie also and therefor it will work on the first page as u set $_COOKIE['cookie'] variable and also after as it will have been refreshed and cookie will be set now.

This is not a problem with PHP it is a limitation of cookies.

Regards
Liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.