SECURITY AND SCALABILITY TRADE-OFFS IN WEB AUTHENTICATION: A COMPARATIVE BENCHMARKING OF JWT AND SESSION-BASED MECHANISMS
Keywords:
Web Authentication, JWT, Session Management, Web Security, Microservices, Scalability, XSS, CSRF, Web Development.Abstract
In modern web development, choosing the right way to log in and identify users (authentication) is one of the most important decisions for software developers. This paper compares two popular authentication methods: traditional Session-based authentication (which uses cookies and stores user data on the server) and modern JSON Web Token (JWT) authentication (which stores user data inside a secure token on the client side). The paper analyzes both methods in terms of server memory usage, speed, system scaling, and resistance to common security threats like Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF). The goal of this research is to give web developers clear and practical guidelines on when to use each authentication approach.
References
1.Nygren, M., & Bäckström, A. (2019). Evaluating Token-Based Authentication Mechanisms in Modern Single-Page Web Applications. KTH Royal Institute of Technology.
2.Jovanovic, M., Stojkov, M., & Vidakovic, M. (2020). Performance evaluation of stateful vs stateless authentication mechanisms in distributed web architectures. Journal of Web Engineering, 19(3), 345-368.
3.Fermín, A., Sánchez, J., & Torres, R. (2021). Microservices security patterns: A comparative performance benchmark of OAuth2 and JWT implementations. IEEE Access, 9, 112450-112462.
4.OWASP Foundation. (2023). JSON Web Token Cheat Sheet for Web Developers. OWASP Cheat Sheet Series.
5.Acar, Y., Stransky, C., Wermke, D., & Mazurek, M. L. (2020). Developers and security: An empirical study of cryptographic API usage in RESTful APIs. IEEE Symposium on Security and Privacy (S&P), 412-429.
6.Jones, M., Bradley, J., & Sakimura, N. (2015). JSON Web Token (JWT). RFC 7519, Internet Engineering Task Force (IETF).
7.Fielding, R. T., & Reschke, J. (2014). Hypertext Transfer Protocol (HTTP/1.1): Authentication. RFC 7235, Internet Engineering Task Force (IETF).
8.Rescorla, E. (2018). The Transport Layer Security (TLS) Protocol Version 1.3. RFC 8446, Internet Engineering Task Force (IETF).
9.Howard, P., & Wright, G. (2022). Benchmarking memory and throughput overheads of token validation in serverless architectures. Software: Practice and Experience, 52(8), 1789-1805.
10.Smith, D., & Brown, L. (2021). Mitigating Cross-Site Scripting (XSS) and Session Hijacking in Modern Web Frameworks. ACM Computing Surveys, 54(4), 1-36.