Urgent! Session State issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

I developed an ASP.NET application that users just started testing and found
a huge problem with. In one part of the application I am creating an
instance of the class and save information that users provided there. If
users want to they can view their previously saved entries. At that time I
display the information to them. Another part of the application has
something similar except I save a dataview object that is declared globally
in the module for the duration of the session.

here is what happens: there were several people testing the application and
there were able to see each others data (from the class or the dataview
variable).

I thought that this information was local for the session. How does it work
and how can I make sure that it is only visible to the user who started the
session? Please help. Thanks.
 
David said:
Hi.

I developed an ASP.NET application that users just started testing and found
a huge problem with. In one part of the application I am creating an
instance of the class and save information that users provided there. If
users want to they can view their previously saved entries. At that time I
display the information to them. Another part of the application has
something similar except I save a dataview object that is declared globally
in the module for the duration of the session.

here is what happens: there were several people testing the application and
there were able to see each others data (from the class or the dataview
variable).

I thought that this information was local for the session. How does it work
and how can I make sure that it is only visible to the user who started the
session? Please help. Thanks.

I had a similar experience with any table that I was filtering. I solved it
by getting the dataview from a copy of the underlying table rather than the
table itself as follows.

dim dt as New datatable
dt = mgDataObjs.mgGetDataTable().copy()
dv = new dataview(dt)
dv.rowfilter ... etc

There may be other or better ways to solve this, but it worked for me.
Hope this helps.

Mike
 
I had a similar experience with any table that I was filtering. I solved it
by getting the dataview from a copy of the underlying table rather than the
table itself as follows.

dim dt as New datatable
dt = mgDataObjs.mgGetDataTable().copy()
dv = new dataview(dt)
dv.rowfilter ... etc

There may be other or better ways to solve this, but it worked for me.
Hope this helps.

Mike
I should point out that, in my case, I store the datatable in cache. My
understanding is when you filter the datatable, even from a dataview, it
changes the view of the underlying table data until it is unfiltered. I
would guess that you are caching your datatables.
 
Actually my problem is that I have several users that work on different
computers can see what others have stored in their local objects (classes,
moduals, public variables).
 
No one can help you if you don't post code that can reproduce this problem.

It sounds like you may have accidentally created a singleton

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
Back
Top