Issue with threading?



This is a long-overdue item on my punch list that I haven't had much time to
address in the past. I'm trying to get it off my plate this week. ;o)

We have a home-grown CMS that works pretty well. One issue we have is that
whenever a page is saved in the CMS, we grab the info about the user that is
saving the page and save it along with the page (so we can track who has
changed what).

This works most of the time.

SOMEtimes, however, it grabs the information from another user that is
logged in. It seems as if my threads are crossing. I'm trying to figure out
what I've failed to do correctly in my code.

To grab the userinfo, we call our class from one of our pages:

SecureUsers.su_strUser

The secureusers class:

=============================

Public Class SecureUsers
Public Shared su_strUser As String
...
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
su_strUser =
Server.HtmlEncode(Request.Cookies("CMSUser")("su_strUser"))
End Sub
End Class

=============================

My guess is that it's the 'public shared' declaration for the su_strUser
string and that this is being set GLOBALLY (vs. per session) whenever any
CMS user calls this class. As such, if two people happen to save a page at
the same time, the info crosses.

If that's the case, what should I be using? Is there where I need to use
properties vs. public variables?

-Darrel

--
=================================================================
Win prizes searching google:
http://www.blingo.com/friends?ref=hM72-GU3FWzMFnTqhv-2GE1FNtA


.



Relevant Pages

  • Re: Persias playing with the string!
    ... >> Persia bats the string around and even though some evil person front ... >> declawed her she manages to grab the string with her paw. ... > using string - even thick ones like shoe/boot laces! ... > turned the ceiling fan on and sat back and LHAO while watching Smokey ...
    (rec.pets.cats.anecdotes)
  • Re: Persias playing with the string!
    ... Tyrone will grab it and drag it and Miss Pua just can't resist ... >> Persia bats the string around and even though some evil person front ... > string - even thick ones like shoe/boot laces! ... > Smokey tried to haul her prey off to be killed - her prey was duly taken ...
    (rec.pets.cats.anecdotes)
  • Re: Textbox line property
    ... Create a textbox multiline option true, and set it to like 25 ... I want to grab as 2 lines out. ... Basically if you have a "super long string" and would like to parse ... what you have after displaying a String are not lines but an image. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Hex to Binary Conversion
    ... In 3 byte chunks i need to grab the ... to binary string conversion), then I will have to take the 2s complement of ... a decimal number which will be a multiplier for a function that I will have ... You want to convert an integer to a string formatted as ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Hex to Binary Conversion
    ... In 3 byte chunks i need to grab the ... a decimal number which will be a multiplier for a function that I will have ... You want to convert an integer to a string formatted as ...
    (microsoft.public.dotnet.languages.csharp)