A common usecase for cookies is to store visitor settings to the visitors browser, so they remain in effect during the entire visit (and for the next visit, depending on the duration of the cookie). WordPress uses a number of different cookies to enhance the user experience. When a visitor logs in, a cookie is stored with the login details to keep the user logged in until he or she chooses to log out.
Cookies are also stored when a non-logged-in visitor posts a comment, so that visitor won’t need to retype their information the next time he or she wants to post a comment. As of WordPress version 4.9.6, which introduced functionality meant to make WordPress GDPR compliant, the comment form has a checkbox that the visitor can check if he or she wants their comment details to be stored.