began logic for sessions and login