I am trying to write a website that has user accounts. There isn\'t much sensitive information other than the password and email address. But I don\'t really understand what I\'
Sarfraz Ahmed brought up some good resources for reading. You could also use a PHP class for user authentication, there are plenty. I my self have put up a project called userFlex on sourceForge http://uflex.sourceforge.net
userFlex has a decent documentation and it does more than just login users; it does registration and field validations, password resets, confirmation codes for registrations, handles sessions and more like autologin.
Again im just putting up userFlex as an example, you could also look into http://www.phpclasses.org/browse/file/5269.html or many other good Classes in PHPclasses.org.