It's fairly common practice these days for web sites that require simple user authentication to store the users passwords in a hashed form rather than plain text.
Just a simple proof-of-concept script showing the basic login / logout process. Added the register_user() function and fixed a small syntax error.