Reputation: 138
I have a Blazor server side web app which I am using to manage client data. A user logs in with a username and password which is validated against a sql server data base. Once logged in they have access to their profile and various functions. This all works fine.
The issue I have is that when user A logs in and then User B accesses the site the site opens with User A's profile logged in and if user B logs off the profile on their machine then User A gets kicked out. This works the same if User B logs in with their profile and then User A accesses the site.
I am new to Blazor so I approached this project as I would a normal web application. It seems a new instance of the app isn't being created on each machine.
What am I doing wrong or is there something I am missing ?
Thanks
Upvotes: 0
Views: 770
Reputation: 2800
Check how you have declared/instanced your services.
If you have a service with a lifetime like singleton, all your users will share the same data returned from the service.
Try to verify in your startup file what's and of lifetime scope have you applied.
Upvotes: 1