Cookies and localStorage/sessionStorage can be used for completely different purposes.
You compared apples to oranges. You can't make decisions on the server side based on localStorage, only with cookies.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Cookies and localStorage/sessionStorage can be used for completely different purposes.
You compared apples to oranges. You can't make decisions on the server side based on localStorage, only with cookies.
If you treat the question as just about how an app stores local information, then they're comparable.
It's more like: if you need the server to be involved without rolling your own system, use cookies, else use *Storage.