सत्र व्यवस्थापन विनंत्या भोवती वापरकर्ते लॉग केलेले ठेवण्याचे संचालन करते — आणि याची सुरक्षितपणे करणे महत्वाचे आहे, कारण सत्र असुरक्षा (अपहरण, निर्धारण) हल्लेकोरांना वापरकर्त्यांचे भूमिका बजावू देते. सुरक्षित सत्रांमध्ये योग्य टोकन हाताळणी, कुकी सुरक्षा, आणि जीवनचक्र व्यवस्थापन समाविष्ट असते.
सत्र कसे कार्य करते
After login, the server keeps a SESSION identifying the user across requests:
→ a SESSION ID (or token) is stored client-side (usually a cookie) and sent each request
→ the server uses it to know who the user is (without re-authenticating each time)
→ the session ID/token is effectively a key to the user's account → must be PROTECTED.
सत्रांची सुरक्षा
✓ SECURE COOKIE flags for session cookies:
→ HttpOnly → JavaScript can't read it (protects against theft via XSS)
→ Secure → sent only over HTTPS (not plaintext)
→ SameSite → not sent on cross-site requests (mitigates CSRF)
✓ Strong, RANDOM, unpredictable session IDs (can't be guessed)
✓ Store session data server-side (or sign/encrypt tokens); transmit over HTTPS only
