Asp.net Sessions Getting Crossed / Mixed Up

后端 未结 7 790
北恋
北恋 2020-12-04 20:19

Few weeks ago we had one of our customers contacting us saying that sometimes when he creates an activity it gets created under someone else\'s name!

We did some t

7条回答
  •  感动是毒
    2020-12-04 20:49

    If you checked that output caching is not the problem

    There is already on answer from me here, but as it turned out my other solution (disabling the output cache) did not really solve our problem for us.

    Since in the question it is stated that caching is turned off, the only other possible (AFAIK) bug that can produce this is what turned out to be the real culprit in our case: we use a private variable in a ActionFilterAttribute.

    And because these are cached, storing private/personal data from a user in this way can also lead to session mix-up!

    This answer describes what our problem was and how to fix it:

    https://stackoverflow.com/a/8937793/1864395

    Also, I think it's good to mention that we were able to reproduce the problem by running Apache JMeter with a scenario for several users at the same time. It's a really nice tool (although not really user friendly/intuitive) used for (among other things) stress-testing. It's probably the only way to diagnose session mix-ups!

提交回复
热议问题