I have used Pear::Auth to achieve this end (building custom CMS) with some success. There is another package that has more features called LiveUser.
They both have methods for creating/deleting users (in mySql), storing sessions, and accessing session data, so they do quite a bit of the heavy lifting for you. That said, neither of these packages are "plug-and-play," but they're about as close as your going to get to your stated goal without using some kind of premade CMS.
Pear packages are not very well documented as a whole, but the Auth docs aren't that bad, and there are some useful examples out there. This is the one I worked from:
http://forums.devshed.com/php-development-5/pear-auth-example-94752.html