D
darrel
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
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