Improving login/logout and implementing user registration