Shameless plug: I have a login script here (http://filletoghoti.com/projects.php) which requires PHP and MySQL, and has been pretty secure in my attempts, though I won't garantee the security, for obvious reasons. I use it in the admin sections of websites I create, and it's fairly flexable, so you should be able to incorporate it pretty easily.
Regarding what you proposed: cookies can work, and they are used in a number of places. Just make sure that the cookie gets deleted upon logout of closing of the browser, and that you set an expiration date, or else you'll have a security hole there.
Also, you shouldn't have the password in the script itself, as that is a security hole as well. It should be stored somewhere else, and access to that should be restricted as much as possible.
I've never used _Halt_Compiler() (or heard of it, for that matter), so I can't comment on it. Though, the exit() function will stop the page from loading any of the content beyond the exit() command.