You should distinguish between session cookies and other cookies:
Session cookies will be deleted as soon as the user closes the browser, they are important to ensure secure session processing and increase user privacy. It would be absurd to ban these cookies.
Persistent cookies , especially third-party cookies , can be stored in the user's browser for a long time. They are often misused to collect information about the user, so the user should be asked if they allow such cookies. Unfortunately, only honest sites will never care about this law / recommendation.
EDIT:
I found a description of exceptions in ICO cookie guides that seem to end up with clean session cookies:
There is an exception to the requirement to provide cookie information and consent, where is the use of the cookie:
(a) for the sole purpose of communicating electronically; or
(b) when such storage or access is strictly necessary for the provision of information society services requested by the subscriber or user.
... This exception is probably applicable, for example, to the cookie used to make sure that when a site user selects the products they want to buy and click "add to cart" or "go to the" Checkout "button, site" remembers what they chose on the previous page. This cookie is strictly necessary to provide the service that the user requests (by accepting the purchase that they want to make at the checkout), and therefore an exception will be applied and consent will not be required.
EDIT2:
If you ask the user to store non-seasonal cookies, and he does not allow them to be stored, save this information in your session, but ask him again when he returns with another session. It is his choice to receive this message whenever the browser has been closed.
source share