feat(curriculum): add interactive examples to client side storage negative patterns lesson (#63832)

Co-authored-by: shy-away <shy-away@tuta.io>
This commit is contained in:
shy-away
2025-11-14 11:55:16 -06:00
committed by GitHub
parent 856a5f683e
commit 7e1f07e384

View File

@@ -5,7 +5,7 @@ challengeType: 19
dashedName: what-are-some-negative-patterns-associated-with-client-side-storage
---
# --description--
# --interactive--
Client-side storage allows websites to store data on a user's device. However, like many technologies, it can be misused.
@@ -31,11 +31,15 @@ This technique uses client-side information to create a unique "fingerprint" of
Here's a simple example of how a website can create a fingerprint of you:
:::interactive_editor
```js
let fingerprintExample = navigator.userAgent + screen.width + screen.height;
console.log(fingerprintExample);
```
:::
This code combines your browser's user agent with your screen dimensions. While this is a basic example, real fingerprinting methods are much more complex and can be highly accurate in identifying users.
`localStorage` can also be misused as some websites use it to store sensitive information insecurely. For instance: