HTTP cookies are an old client-side storage mechanism with inherent risks and limitations. Use Web Storage, IndexedDB or other modern methods instead.
Cookies should be used only in rare and justifiable cases after thorough security review.