Cookies & Attributes Playground

The real document.cookie: write HttpOnly from a script, SameSite=None without Secure, a 5000-byte note, or a delete without the Path, then see what the…

Why it matters

A token in localStorage can be stolen by XSS. Forgetting SameSite opens CSRF. Forgetting Secure leaks the cookie over HTTP. A big cookie weighs down every request. Cookie attribute mistakes are real security and performance holes.

The key idea

A cookie’s attributes, not its value, decide whether it is safe or leaks

Common mistakes

Try it in this playground