localStorage exposes tokens to any script on the page. Cookies avoid that and introduce cross-site request risk. Neither choice is…