It's legal to use cookies for behaviour such as login which is necessary but you need consent for tracking.
If a browser blocked all cookies until the user turned them on you'd have the choice of "no login" or "login works, but so does all the tracking".
Not saying the current state of affairs is good, it's awful.