Originally Posted by Fou-Lu
One thing not yet mentioned is your use of short tags. Since this is a directive, you should not be using short_open_tags in your code. If it is not enabled, <? . . . ?> is considered as an element in HTML and will be rendered as such.
Very nice explanation on the whole cookie deal Fou-Lu, but in particular on the short tags which is one reason why every time i see a short tag i replace it with a full tag. The only time i use anything like a short tag is when im displaying something like
other than that its all full tags. For some reason i have a problem or i just dont like php echo ???? i even try to stay away from php print, i dont know why im a fussy guss i guess lol.
Awhile back i had a tough time with cookie as well, fought it for days till Fou-Lou helped me out, same issue. In that case i pulled the value of the cookie to use on another value when the site loaded.
What i had to do was when the site first loaded i had to hard code a value for the var. Then after that it was fine, because the page was reloaded by the visitor after that and the cookie was set. But at first load of the site if you need that cookie value it is not there yet. Thats just the way it is.
You might have to use a session value for first load and then the cookie after that.