The original cookie specification from 1997 was GDPR compliant (2019)
baekdal.com
baekdal.com
It's worth pointing out that instead of cookies we could have gone with a system where the client (browser) kept a copy of all the state and returned it to the server on every request. The cookie-based session state management was chosen because it was decided it was too inefficient to pass the entire state back and forth between the client and server.