Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

ASP.NET session switch

9 réponses
Avatar
cti
Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks

9 réponses

Avatar
Patrice
Typically this is an incorrect usage of static (c#) or shared (VB)
variables. They are shared by the whole application and ASP.NET runs as a
single application. So if multiple users are hitting the site at the same
time they'll work on the same data sometimes resulting in displaying other
users data.

Do you have static or shared variable in the part that causes this problem ?

--
Patrice

"cti" a écrit dans le message de groupe de
discussion :

Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks


Avatar
Delf
Il se trouve que cti a formulé :
Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks



It seems you are using a shared object between user sessions.
Do you use Application["..."] object to store current user data?
Avatar
cti
On 21 nov, 17:09, "Patrice" <http://www.chez.com/scribe/> wrote:
Typically this is an incorrect usage of static (c#) or shared (VB)
variables. They are shared by the whole application and ASP.NET runs as a
single application. So if multiple users are hitting the site at the same
time they'll work on the same data sometimes resulting in displaying othe r
users data.

Do you have static or shared variable in the part that causes this proble m ?

--
Patrice

"cti" a écrit dans le message de grou pe de
discussion :

Hi,


thanks for your answer .
yes I had static variables and methods but not any more !
Now i instance every object.
I don't have idea any more :(




> Hi,

> I'm currently developping a website using C# (ASP.NET framework 2.0).
> On a page of the site there is a treeview ( 2.0 .Net component) on the
> left from which you can open the details of nodes by clicking them. We
> have a weird behaviour: sometimes when 2 users are accessing the site
> simultaneously, a user gets the other user's data and vice versa.
> Does someone have any idea whats's happening?
> Thanks- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -


Avatar
cti
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf wrote:
Il se trouve que cti a formulé :

> Hi,

> I'm currently developping a website using C# (ASP.NET framework 2.0).
> On a page of the site there is a treeview ( 2.0 .Net component) on the
> left from which you can open the details of nodes by clicking them. We
> have a weird behaviour: sometimes when 2 users are accessing the site
> simultaneously, a user gets the other user's data and vice versa.
> Does someone have any idea whats's happening?
> Thanks

It seems you are using a shared object between user sessions.
Do you use Application["..."] object to store current user data?


Avatar
cti
On 24 nov, 09:54, cti wrote:
Hi,

no , i don't have  Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf wrote:



> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on th e
> > left from which you can open the details of nodes by clicking them. W e
> > have a weird behaviour: sometimes when 2 users are accessing the site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?- Masqu er le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.
Avatar
Delf
cti a couché sur son écran :

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .



No, the ViewState object is associated with the user Web page only.
It is not because of this...
Avatar
Delf
cti vient de nous annoncer :

yes I had static variables and methods but not any more !
Now i instance every object.
I don't have idea any more :(



Can you give us the source code of the object that raises the problem.
And another one that shows us how it is retreived.

Perhaps a singleton instance that manages shared objects?

Thanks.

--
Delf
Avatar
Patrice
Likely because it happens when two useds are hitting the site at the same
time.

Knowing how you store the data that seems to be shared would be helpfull in
finding out what goes wrong...

--
Patrice


"cti" a écrit dans le message de groupe de
discussion :

On 24 nov, 09:54, cti wrote:
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf wrote:



> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on
> > the
> > left from which you can open the details of nodes by clicking them.
> > We
> > have a weird behaviour: sometimes when 2 users are accessing the site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?-
> Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.


Avatar
Patrice
BTW this is a French speaking group. You may want to try an English group
instead unless you speak French too ;-)...



"Patrice" <http://www.chez.com/scribe/> a écrit dans le message de groupe de
discussion :
Likely because it happens when two useds are hitting the site at the same
time.

Knowing how you store the data that seems to be shared would be helpfull
in finding out what goes wrong...

--
Patrice


"cti" a écrit dans le message de groupe
de discussion :

On 24 nov, 09:54, cti wrote:
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf wrote:



> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework
> > 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on
> > the
> > left from which you can open the details of nodes by clicking them.
> > We
> > have a weird behaviour: sometimes when 2 users are accessing the
> > site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?-
> Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.