How to fix session getting null when multiple user request at same time in .net 6.0

Shailesh Thummar 0 Reputation points
2023-02-08T07:18:49.55+00:00

Any solution for "Session getting null when multiple user visit the site" Error?

I analyze the iis worker process physical memory not exceed more than 3GB?

Windows development Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-02-09T03:35:21.2866667+00:00

    Hi @Shailesh Thummar

    I analyze the iis worker process physical memory not exceed more than 3GB

    Based on your description, have you set a virtual memory limit of 3GB for the application pool? Something like this: enter image description here If this is the case, then this result is in line with expectations. When the memory reserved by the worker process exceeds this value, IIS will start a new process and recycle the old one. And in-memory session state is stored in the memory of the IIS worker process. So whatever state maintained by the worker process, including any session objects, is lost.

    In this case, you may need to store session data outside of the IIS worker process, for example in SQL server.

    Here's a good article that might help you: https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/iis-best-practices/ba-p/1241577

    In addition, I found you have posted a similar thread, if they are the same issue, I will follow you here.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.