hello ,
I coded a pretty basic but highly functional login/logout mechanism in PHP and Mysql with session. I thought it will be very good for beginner.
also you can understand how it will work :)
i assured you will enjoy ,
if any issue please share with comments
here is the link ...