Added login/logout button handling and cookie deletion on logout.