There was a script you could use to patch it. Basically, PHP was putting system-generated variables in user space where they could be overwritten by user-supplied values in a form. That's been fixed in later versions, so if you're using the latest you shouldn't have a problem.
As for the session stuff, get thee to [link|http://www.php.net/manual/en/ref.session.php|the source]. Actually, the online documentation is fairly thorough. There are occasional oddities, but the user-contributed notes on each page usually cover that. I wouldn't bother with a book on it at first. You should be able to get most of what you need to get started from the [link|http://www.php.net/manual/en/|online manual].