1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to Prevent Session Conflicts in a Node.js Backend with SQL Server and Multiple Users?...

Discussão em 'Angular' iniciado por Malavika, Maio 31, 2025.

  1. Malavika

    Malavika Guest

    I have a Node.js backend running for an Angular application hosted on IIS, where each user logs in using their own SQL Server credentials. When multiple users are logged in simultaneously, I found an issue: users are receiving data meant for other users, as if the database connection is being shared or overwritten. We're currently using the mssql package to manage connections. Is there any way to prevent this kind of cross-user conflict?

    I initially tried using express-session to manage sessions, but it led to domain-related issues where cookies couldn't be saved or accessed properly—likely due to CORS restrictions between the Angular frontend hosted on IIS and the Node.js backend. Next, I implemented custom session handling using headers that included a session ID. This required reconnecting to the SQL Server database on every API call, which I did not want because I don't store user passwords for security reasons. Therefore, reconnecting is not possible.

    Continue reading...

Compartilhe esta Página