If you've ever worked with PHP and sessions/cookies/headers for very long, then you know the all too familiar "Cannot modify headers" message that can sometimes accompany some of your code. Well, EvilWalrus.com has a plan to change that.
In this latest article, Dealing with "cannot modify header" errors, they show you the correct way to place functions like setcookie and header in reference to the rest of your code. There's even some mention of using the output buffering functionality of PHP to create a buffer before sending your output to the client's browser. This can allow you to set a cookie or add a header just about anywhere in between.
This article is a good starting place, but I wished they had gotten a bit more into the output buffering. That can really be a life-saver sometimes...




