Dhivya P’s Post

View profile for Dhivya P

PS Digitise LLP1K followers

Ever noticed how a website still knows it’s you even after a refresh? No magic. Just smart engineering working behind the scenes. Let’s break it down in a simple way 👇 🔐 How the Web Remembers You Every time you log in, the system needs a way to identify you on the next request. That’s where three core concepts come in: 🍪 Cookies - Small but Powerful Cookies live in your browser. They store tiny pieces of data and automatically travel with every request to the server. ✔ Used for preferences (theme, language) ✔ Can store session IDs ✔ Lightweight and fast But: Not ideal for sensitive data unless secured properly. 🗂️ Sessions - Server-Side Control Sessions shift the responsibility to the server. Instead of storing your data in the browser, the server: • Creates a session ID • Stores your data internally • Sends only the ID back to your browser (via cookie) ✔ More secure ✔ Full control on the server ❌ Can become heavy at scale 🪪 Tokens (JWT) - The Modern Approach Tokens are like a self-contained identity card. The server gives you a signed token that includes your data. Every request carries this token, and the server simply verifies it. ✔ Stateless (no server storage needed) ✔ Scales easily across services ✔ Perfect for APIs & mobile app. But: Needs careful handling (expiry, storage, security). ⚖️ So, what should you use? • Building a traditional web app? --> Sessions + Cookies work well • Building APIs / mobile apps / microservices? --> Tokens (JWT) are a better fit 💡 Understanding this is key to building secure and scalable applications. It’s not just about login - it’s about trust between client and server. #WebDevelopment #FullStackDeveloper #SoftwareEngineering #Programming #CodingLife #BackendDevelopment #FrontendDevelopment #TechExplained #CyberSecurity #APIDevelopment #MERNStack #DeveloperCommunity #LearnToCode #BuildInPublic

  • graphical user interface, website

To view or add a comment, sign in

Explore content categories