Cookies should always be loaded before the page content is printed on screen, or even any HTML is processed. Cookies will not work if you already have printed something in HTML on screen, and it will leave a nasty header error.
The main problem you guys have is this. You directly print the content the moment it gets read. Instead, the content should be put in a separate string first before being output to the actual page. This will require a bit more CPU, but in the end a lot of functions perform better.
The main problem you guys have is this. You directly print the content the moment it gets read. Instead, the content should be put in a separate string first before being output to the actual page. This will require a bit more CPU, but in the end a lot of functions perform better.