Jump to content


Photo

Cookie Problem (dont slap me...)


  • Please log in to reply
2 replies to this topic

#1 matfish

matfish
  • Members
  • PipPipPip
  • Advanced Member
  • 242 posts
  • LocationUK

Posted 11 July 2006 - 12:04 PM

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

#2 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 11 July 2006 - 12:12 PM

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">
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#3 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 11 July 2006 - 12:13 PM

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
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users