Can a single asp.net user make more than one request at a time if the Session is in use?

前端 未结 2 1960
日久生厌
日久生厌 2020-12-14 19:53

I am not able to make more than one request at a time in asp.net while the session is active. Why does this limitation exist? Is there a way to work around it?

This

2条回答
  •  情书的邮戳
    2020-12-14 20:26

    For reasons Kevin described, users can't access two pages that might write to their session state at the same time - the framework itself can't exert fine-grained control over the locking of the session store, so it has to lock it for entire requests.

    To work around this, pages that only read session data can declare that they do so. ASP.NET won't obtain a session state write lock for them:

    // Or false if it doesn't need access to session state at all
    EnableSessionState="ReadOnly"
    

提交回复
热议问题