Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Don Ross 28 posts 49 karma points
    Jan 25, 2012 @ 23:37
    Don Ross
    0

    Object overwritten by different session

    I have been using Umbraco for about a year now and have always noticed and been perplexed about how c sharp objects persist between page loads. Recently, a particular object that is not static is being overwritten by other sessions, therefore showing data for other user's sessions in the wrong session. I have been Googling this for hours to try to figure out how to prevent this object from being overwritten between sessions to no avail. I also tried saving the object by serializing and sticking in a unique cache space per user, but this still does not prevent this object from being overwritten between sessions. Another consideration I am looking at is that I am sharing a single ADO connection for the page lifecycle, so I am wondering if perhaps it is a database connection issue. I am using MARS connection. Does anyone have any advice for me on how to prevent this from happening?

    Thanks!

    Don

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 26, 2012 @ 06:42
    Jeroen Breuer
    0

    Could you explain what session you're talking about? I've never had any problems, but I use a normal connection. Why do you use a MARS connection?

    Jeroen

  • Don Ross 28 posts 49 karma points
    Jan 26, 2012 @ 13:37
    Don Ross
    0

    Thanks for responding, I narrowed it down to the object, not the database connection. I can reproduce the following scenario. Two users access a web page at around the same time and they each receive the others data from an object that identifies who they are in the system. Not exactly sure what is causing this issue, but definitely unnacceptable. This object is binary serialized and stored in session, so on page load, the session variable is deserialized back out to the object. When stored in session, it is stored with a key of the user id, which is gauranteed to be unique. I think it may be how I am deserializing the object, which is happening in a method of itself. I will try moving this out of the class to see if I can reproduce the issue.

Please Sign in or register to post replies

Write your reply to:

Draft