added login and logout features with database connection