Working login and logout on front-end