added basic user auth and some form validation

added user auth: register, log-in, update lastloggedin and sessions