Thanks for posting this. I had been searching for quite some time.

If you use ZF (Zend Framework), the “cookie jar” implementation/class might be somewhat helpful, too (depending on what you’re trying to do, of course) :-)