All in the <head> – Ponderings and code by Drew McLellan –

Sessions, hah! What are they good for?

We’ve been having some trouble at work with PHP session variables. It’s an evil Windows installation (don’t blame me, blame Pitman), I’ve pretty much concluded that it’s simply the implementation being flaky rather than a specific bug in the code. We’re getting a lot of now-it’s-working, now-it’s-not (NIWNIN?). Basically I suspect we might end up abandoning using PHP session management and rolling our own. What’s a girl to do?

The question of the day is – how do you manage your sessions? Are they any nice classes out there worth using? Should we stick with plain old cookies or use something more URLified? I see that with the PHP session handling functions you can set up your own save handler to use whatever mechanism you like. Possibly we might have more success setting a handler that uses our MySQL database. However, I’m not sure where within the PHP session handling the problem is occurring, so that may well not be an answer.

Any insights as to how you handle session management in PHP are seriously welcomed.