To expand on the "not as secure" comment: local storage is accessible to every JS that runs in the context of the page. This includes anything loaded into the page via <script src=""/> like tracking or cookie consent services.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#bl...