Log in and log out help

There are plugins that will help with this. You probably want to take
a look at something like restful authentication (http://wiki.github.com/technoweenie/restful-authentication
) - this will provide the basic stuff you need to get started.
Authlogic (http://wiki.github.com/binarylogic/authlogic) is apparently
pretty good too.