If you use web2py you have Role Based Access Control out of the box.
It includes pages for login, register, logout, change password, edit
profile, reset password, verify email. It has pluggable components so
that you can authenticate users with password, openid, gmail, twitter,
etc.