---
title: "Discussion on \"How to Encrypt Sensitive Data in LocalStorage (When You Really Have No Choice)\" | Hashnode"
description: "Discussion on \"How to Encrypt Sensitive Data in LocalStorage (When You Really Have No Choice)\". In an ideal world, sensitive data would never touch localStorage. Session state would live in httpOnly cookies, large client-side data would sit in IndexedDB, and secrets would stay firmly on the server.\nBut production is rarely ideal.\nSometimes you ..."
url: "https://hashnode.com/posts/how-to-encrypt-sensitive-data-in-localstorage-when-you-really-have-no-choice/697786a33ee179e81bfe7bba"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Encrypt Sensitive Data in LocalStorage (When You Really Have No Choice)](https://hexplain.hashnode.dev/how-to-encrypt-sensitive-data-in-localstorage-when-you-really-have-no-choice?utm_source=hashnode&utm_medium=feed)

In an ideal world, sensitive data would never touch localStorage. Session state would live in httpOnly cookies, large client-side data would sit in IndexedDB, and secrets would stay firmly on the server. But production is rarely ideal. Sometimes you ...

Jan 23 · 3 min read · hexplain.hashnode.dev  
Read the article

-   [#cybersecurity](https://hashnode.com/tag/cybersecurity)

## Written by

[Utkarsh Gaur](https://hashnode.com/@ugaurx)

@ugaurx

  
[View profile](https://hashnode.com/@ugaurx)

a community guy!'

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
