login functionality with sessions and passwords