I'm building a site that has a few user options like dark or light mode (overriding the system default), default to X layout instead of Y, etc. None of these options need to be sent to the server. Is there a way that my JS can set cookies that aren't set to server? I was thinking maybe local storage is the solution but I know people get annoyed when they clear cookies and settings stick around (because local storage != cookie)
Is there a way that my JS can set cookies that aren't set to server?
Not as far as I'm aware. Any cookies that are visible to the site (which is what you'd want if you need to read them in JS) will be sent with any requests to the server. Unless you specifically add logic server-side which looks at those cookie values though, it likely won't actually do anything even if you do send them to the server.
You could use sessionStorage instead of localStorage if you don't mind it being cleared out when users close the tab (see https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).