Time for a fun technology lesson in case others are wondering why this works.
Most web traffic uses a layer 7 network protocol (See OSI model) called HTTP with a second layer 6 protocol (the S in HTTPS) to provide encryption.
I won't get into HTTPS specifically. Every time your web browser requests a page such as Gmail an HTTP request is sent. HTTP is a stateless protocol meaning every request is completely unrelated to every other HTTP request and on it's own a service like Gmail doesn't know two requests came from the same user.
Enter the cookie. A cookie is a piece of data that sits on the user's computer (often in some form of cache each browser maintains). A session cookie, which ultimately is just another cookie, is generated when you log into a service such as Gmail and will often contain a long random string. Implementation of an usage of cookies is entirely at the discretion of the service provider (i.e. Gmail) The session cookie is only generated after successfully authenticating to a service. The cookie value is tracked on the service side and stored in your browser. Now every time you send those stateless HTTP requests that session cookie is also sent. The service, such as Gmail, will validate that cookie value against what they have stored and know which user is sending the HTTP request and return your specific data.
You could use that without problems, when you make exceptions for those sites that you want to allow cookies to stay.
You do that in the Privacy settings, Exceptions - Cookies and Site Data.
This is my exception window. It was in Dutch, but I edited it all to corresponding English words. Hope i did it right!
My Computer
At a glance
Windows 11 Pro 25H2AMD Ryzen 7 5700GKingston FURY Beast 2x16GB DIMM DDR4 2666 CL16MSI GeForce GT 730 2GB LP V1