MockReal Logo
Home
BlogPricing
For Employers →
  1. Home
  2. Questions
  3. How do sessions work?

How do sessions work?

TechnicalSecurity Operations EngineerWeb Application Security EngineerNetwork Security Engineer

Sessions are a way to maintain state and track user interactions in web applications. When a user logs in, a session is created on the server, which generates a unique session ID. This ID is then sent to the client, typically stored in a cookie, allowing the server to recognize subsequent requests from the same user. This process is crucial for maintaining user authentication and personalization across multiple requests.

For example, when a user logs into an online banking platform, their session ID allows the server to retrieve their account details and maintain their logged-in state. If the session expires, the user will need to log in again, which is a common security measure to prevent unauthorized access.

There are different session management techniques, such as server-side sessions and JWT (JSON Web Tokens). Server-side sessions store session data on the server, which can be more secure but requires server memory management. In contrast, JWTs store user data in the token itself, allowing for stateless authentication but potentially exposing sensitive information if not properly secured. Choosing between these options depends on the application’s scalability and security requirements.

More Questions

  • Describe HTTPs and how it is used.
  • Describe SSL handshake.
  • How do cookies work?
  • How does HTTPS work?
  • How do web certificates for HTTPS work?
  • How is pad lock icon in browser generated?
  • What is the difference between HTTPS and SSL?
  • What is the purpose of TLS?
  • Describe the difference between synchronous and asynchronous encryption.
  • Describe the hardening measures you've put on your home network.
MockReal Logo

Spoken interview practice for technical professionals

Product

  • Pricing
  • Questions
  • Positions
  • Resumes
  • For Employers →

Company

  • Careers
  • About Us
  • Contact
  • Blog

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2025 MockReal. Spoken interview practice. All rights reserved.