جدید applications مختلف authentication mechanisms استعمال کرتی ہیں — session-based، token-based (JWT)، اور delegated authentication (OAuth/OpenID Connect)۔ یہ سمجھنا کہ ہر ایک کیسے کام کرتا ہے، اور ان کے trade-offs کیا ہیں، محفوظ authentication implement کرنے کے لیے اہم ہے۔
Session-based authentication
SESSION-based (traditional):
→ user logs in → server creates a SESSION (stored server-side) → sends a session ID
cookie → the browser sends it with each request → server looks up the session
✓ server controls sessions (easy to revoke); simple; cookie auto-sent
✗ stateful (server stores sessions); scaling needs shared session storage
