473,224 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Session Variables getting cross threaded

Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned to
them. I can't figure out why. I've read that other people are having this
problem too but I haven't found a resolution yet. Can someone please tell me
how I might go about fixing this?

Thanks
Nov 19 '05 #1
9 3149
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned
to them. I can't figure out why. I've read that other people are having
this problem too but I haven't found a resolution yet. Can someone please
tell me how I might go about fixing this?


What's the environment? OS, IIS, etc...
Nov 19 '05 #2
Sorry, the app is using .NET v1.1.4322, the OS on the server is Server
2003...so I think the IIS version would be 6?
I'm wondering if it might be caused by using static variables?
Thanks for your help

"Christoph Wienands" <ch****************@siemens.remove.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned
to them. I can't figure out why. I've read that other people are having
this problem too but I haven't found a resolution yet. Can someone please
tell me how I might go about fixing this?


What's the environment? OS, IIS, etc...

Nov 19 '05 #3
In particular...what is happening is...say two users are logged in. There is
a dropdown listbox which contains paypools. If the user changes paypools,
then the Session["paypool"] for that user is set to this. There are several
buttons on this page which go to different pages. One goes to a screen which
uses the Session["paypool"] object in a query (to Oracle) to populate this
new page. If both users click this button very close to the same time, the
second user will get the Session["paypool"] object of the other user.
"Christoph Wienands" <ch****************@siemens.remove.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned
to them. I can't figure out why. I've read that other people are having
this problem too but I haven't found a resolution yet. Can someone please
tell me how I might go about fixing this?


What's the environment? OS, IIS, etc...

Nov 19 '05 #4
this is almost always a bug in the asp.net code. most likely you are storing
a reference to a session variable in vb module (shared). this is a no, no,
as vb module variables are shared across threads.

-- bruce (sqlwork.com)
"Randy" <te**@temp.com> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
In particular...what is happening is...say two users are logged in. There
is a dropdown listbox which contains paypools. If the user changes
paypools, then the Session["paypool"] for that user is set to this. There
are several buttons on this page which go to different pages. One goes to
a screen which uses the Session["paypool"] object in a query (to Oracle)
to populate this new page. If both users click this button very close to
the same time, the second user will get the Session["paypool"] object of
the other user.
"Christoph Wienands" <ch****************@siemens.remove.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
Hello,
I'm having a strange problem. I've got a .NET web app which uses Session
variables. Sometime, not all the time, they get cross threaded...that
is...one user will have another user's Session variable(s) data assigned
to them. I can't figure out why. I've read that other people are having
this problem too but I haven't found a resolution yet. Can someone
please tell me how I might go about fixing this?


What's the environment? OS, IIS, etc...


Nov 19 '05 #5
My app is in C#. I'm not very familiar with VB...the VB Module you're saying
is shared across threads? I didn't know that. But in my C# app, I'm not
sharing it that I'm aware of.
Thanks
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this is almost always a bug in the asp.net code. most likely you are
storing a reference to a session variable in vb module (shared). this is a
no, no, as vb module variables are shared across threads.

-- bruce (sqlwork.com)
"Randy" <te**@temp.com> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
In particular...what is happening is...say two users are logged in. There
is a dropdown listbox which contains paypools. If the user changes
paypools, then the Session["paypool"] for that user is set to this. There
are several buttons on this page which go to different pages. One goes to
a screen which uses the Session["paypool"] object in a query (to Oracle)
to populate this new page. If both users click this button very close to
the same time, the second user will get the Session["paypool"] object of
the other user.
"Christoph Wienands" <ch****************@siemens.remove.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
Hello,
I'm having a strange problem. I've got a .NET web app which uses
Session variables. Sometime, not all the time, they get cross
threaded...that is...one user will have another user's Session
variable(s) data assigned to them. I can't figure out why. I've read
that other people are having this problem too but I haven't found a
resolution yet. Can someone please tell me how I might go about fixing
this?

What's the environment? OS, IIS, etc...



Nov 19 '05 #6
Do you have static variables ? They are shared by the whole application
(i.e. all sessions using *the* application).

--
Patrice

"Randy" <te**@temp.com> a écrit dans le message de
news:Oz**************@TK2MSFTNGP12.phx.gbl...
My app is in C#. I'm not very familiar with VB...the VB Module you're saying is shared across threads? I didn't know that. But in my C# app, I'm not
sharing it that I'm aware of.
Thanks
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this is almost always a bug in the asp.net code. most likely you are
storing a reference to a session variable in vb module (shared). this is a no, no, as vb module variables are shared across threads.

-- bruce (sqlwork.com)
"Randy" <te**@temp.com> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
In particular...what is happening is...say two users are logged in. There is a dropdown listbox which contains paypools. If the user changes
paypools, then the Session["paypool"] for that user is set to this. There are several buttons on this page which go to different pages. One goes to a screen which uses the Session["paypool"] object in a query (to Oracle) to populate this new page. If both users click this button very close to the same time, the second user will get the Session["paypool"] object of the other user.
"Christoph Wienands" <ch****************@siemens.remove.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Randy,

"Randy" <te**@temp.com> wrote in message
news:O5*************@tk2msftngp13.phx.gbl...
> Hello,
> I'm having a strange problem. I've got a .NET web app which uses
> Session variables. Sometime, not all the time, they get cross
> threaded...that is...one user will have another user's Session
> variable(s) data assigned to them. I can't figure out why. I've read
> that other people are having this problem too but I haven't found a
> resolution yet. Can someone please tell me how I might go about fixing> this?

What's the environment? OS, IIS, etc...



Nov 19 '05 #7
Yes, I do have static variables. I'm not using any of them (that I know of)
to assign a value directly to a Session variable, but use of static
variables sounds like that might be what is causing it? Should I not use any
static variables?
"Patrice" <no****@nowhere.com> wrote in message
news:OY****************@tk2msftngp13.phx.gbl...
Do you have static variables ? They are shared by the whole application
(i.e. all sessions using *the* application).

--
Patrice

"Randy" <te**@temp.com> a écrit dans le message de
news:Oz**************@TK2MSFTNGP12.phx.gbl...
My app is in C#. I'm not very familiar with VB...the VB Module you're

saying
is shared across threads? I didn't know that. But in my C# app, I'm not
sharing it that I'm aware of.
Thanks
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> this is almost always a bug in the asp.net code. most likely you are
> storing a reference to a session variable in vb module (shared). this
> is a > no, no, as vb module variables are shared across threads.
>
> -- bruce (sqlwork.com)
>
>
> "Randy" <te**@temp.com> wrote in message
> news:ew**************@tk2msftngp13.phx.gbl...
>> In particular...what is happening is...say two users are logged in. There >> is a dropdown listbox which contains paypools. If the user changes
>> paypools, then the Session["paypool"] for that user is set to this. There >> are several buttons on this page which go to different pages. One goes to >> a screen which uses the Session["paypool"] object in a query (to Oracle) >> to populate this new page. If both users click this button very close to >> the same time, the second user will get the Session["paypool"] object of >> the other user.
>>
>>
>> "Christoph Wienands" <ch****************@siemens.remove.com> wrote in
>> message news:%2****************@TK2MSFTNGP12.phx.gbl...
>>> Hey Randy,
>>>
>>> "Randy" <te**@temp.com> wrote in message
>>> news:O5*************@tk2msftngp13.phx.gbl...
>>>> Hello,
>>>> I'm having a strange problem. I've got a .NET web app which uses
>>>> Session variables. Sometime, not all the time, they get cross
>>>> threaded...that is...one user will have another user's Session
>>>> variable(s) data assigned to them. I can't figure out why. I've read
>>>> that other people are having this problem too but I haven't found a
>>>> resolution yet. Can someone please tell me how I might go about fixing >>>> this?
>>>
>>> What's the environment? OS, IIS, etc...
>>>
>>
>>
>
>



Nov 19 '05 #8
Do you affect a session value to such a variable ?

Those variables have an application wide scope. In the case of ASP.NET, it
means they are shared accross all sessions. So you 'll usually won't want
them in an ASP.NET application.

(using a shared property that return the value from the session variable
would work and could be a quick way to fix this problem).

--
Patrice

"Randy" <te**@temp.com> a écrit dans le message de
news:Or**************@TK2MSFTNGP10.phx.gbl...
Yes, I do have static variables. I'm not using any of them (that I know of) to assign a value directly to a Session variable, but use of static
variables sounds like that might be what is causing it? Should I not use any static variables?
"Patrice" <no****@nowhere.com> wrote in message
news:OY****************@tk2msftngp13.phx.gbl...
Do you have static variables ? They are shared by the whole application
(i.e. all sessions using *the* application).

--
Patrice

"Randy" <te**@temp.com> a écrit dans le message de
news:Oz**************@TK2MSFTNGP12.phx.gbl...
My app is in C#. I'm not very familiar with VB...the VB Module you're

saying
is shared across threads? I didn't know that. But in my C# app, I'm not
sharing it that I'm aware of.
Thanks
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> this is almost always a bug in the asp.net code. most likely you are
> storing a reference to a session variable in vb module (shared). this
> is

a
> no, no, as vb module variables are shared across threads.
>
> -- bruce (sqlwork.com)
>
>
> "Randy" <te**@temp.com> wrote in message
> news:ew**************@tk2msftngp13.phx.gbl...
>> In particular...what is happening is...say two users are logged in.

There
>> is a dropdown listbox which contains paypools. If the user changes
>> paypools, then the Session["paypool"] for that user is set to this.

There
>> are several buttons on this page which go to different pages. One goes
to
>> a screen which uses the Session["paypool"] object in a query (to

Oracle)
>> to populate this new page. If both users click this button very
close to
>> the same time, the second user will get the Session["paypool"]
object of
>> the other user.
>>
>>
>> "Christoph Wienands" <ch****************@siemens.remove.com> wrote

in >> message news:%2****************@TK2MSFTNGP12.phx.gbl...
>>> Hey Randy,
>>>
>>> "Randy" <te**@temp.com> wrote in message
>>> news:O5*************@tk2msftngp13.phx.gbl...
>>>> Hello,
>>>> I'm having a strange problem. I've got a .NET web app which uses
>>>> Session variables. Sometime, not all the time, they get cross
>>>> threaded...that is...one user will have another user's Session
>>>> variable(s) data assigned to them. I can't figure out why. I've read >>>> that other people are having this problem too but I haven't found a >>>> resolution yet. Can someone please tell me how I might go about

fixing
>>>> this?
>>>
>>> What's the environment? OS, IIS, etc...
>>>
>>
>>
>
>



Nov 19 '05 #9
I was using a static in the screen (aspx file) where the anomaly was
occuring. I took out the static and slightly recoded and I believe it fixed
it! I can't seem to reproduce the anomaly. I'll keep testing, but I really
appreciate everyones help!
I'll never use static in an ASP app again :)
Thanks!

"Patrice" <no****@nowhere.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
Do you affect a session value to such a variable ?

Those variables have an application wide scope. In the case of ASP.NET, it
means they are shared accross all sessions. So you 'll usually won't want
them in an ASP.NET application.

(using a shared property that return the value from the session variable
would work and could be a quick way to fix this problem).

--
Patrice

"Randy" <te**@temp.com> a écrit dans le message de
news:Or**************@TK2MSFTNGP10.phx.gbl...
Yes, I do have static variables. I'm not using any of them (that I know

of)
to assign a value directly to a Session variable, but use of static
variables sounds like that might be what is causing it? Should I not use

any
static variables?
"Patrice" <no****@nowhere.com> wrote in message
news:OY****************@tk2msftngp13.phx.gbl...
> Do you have static variables ? They are shared by the whole application
> (i.e. all sessions using *the* application).
>
> --
> Patrice
>
> "Randy" <te**@temp.com> a écrit dans le message de
> news:Oz**************@TK2MSFTNGP12.phx.gbl...
>> My app is in C#. I'm not very familiar with VB...the VB Module you're
> saying
>> is shared across threads? I didn't know that. But in my C# app, I'm
>> not
>> sharing it that I'm aware of.
>> Thanks
>>
>>
>> "Bruce Barker" <br******************@safeco.com> wrote in message
>> news:%2****************@TK2MSFTNGP09.phx.gbl...
>> > this is almost always a bug in the asp.net code. most likely you are
>> > storing a reference to a session variable in vb module (shared).
>> > this
>> > is
> a
>> > no, no, as vb module variables are shared across threads.
>> >
>> > -- bruce (sqlwork.com)
>> >
>> >
>> > "Randy" <te**@temp.com> wrote in message
>> > news:ew**************@tk2msftngp13.phx.gbl...
>> >> In particular...what is happening is...say two users are logged in.
> There
>> >> is a dropdown listbox which contains paypools. If the user changes
>> >> paypools, then the Session["paypool"] for that user is set to this.
> There
>> >> are several buttons on this page which go to different pages. One goes > to
>> >> a screen which uses the Session["paypool"] object in a query (to
> Oracle)
>> >> to populate this new page. If both users click this button very close > to
>> >> the same time, the second user will get the Session["paypool"] object > of
>> >> the other user.
>> >>
>> >>
>> >> "Christoph Wienands" <ch****************@siemens.remove.com> wrote in >> >> message news:%2****************@TK2MSFTNGP12.phx.gbl...
>> >>> Hey Randy,
>> >>>
>> >>> "Randy" <te**@temp.com> wrote in message
>> >>> news:O5*************@tk2msftngp13.phx.gbl...
>> >>>> Hello,
>> >>>> I'm having a strange problem. I've got a .NET web app which uses
>> >>>> Session variables. Sometime, not all the time, they get cross
>> >>>> threaded...that is...one user will have another user's Session
>> >>>> variable(s) data assigned to them. I can't figure out why. I've read >> >>>> that other people are having this problem too but I haven't found a >> >>>> resolution yet. Can someone please tell me how I might go about
> fixing
>> >>>> this?
>> >>>
>> >>> What's the environment? OS, IIS, etc...
>> >>>
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Joel Brabant | last post by:
How can I know if a user session had timed out ? I always get an error in my asp page when I try to access my session variable if it timed out. Thank You.
14
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to...
7
by: Adam Short | last post by:
I'm having all sorts of problems with Sessions, I've been using them for years with out a hitch, all of a sudden the last 6 - 12 months since getting our new Win2003 server it's all gone shakey!!!...
6
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the...
4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
2
by: fizbang | last post by:
This should be impossible, but for some reason, people are not getting individual sessions. They start a session. I set the session("application") variable to the unique number generated by an...
1
by: Larry Neylon | last post by:
Hi, I'm working on a VBScript application on IIS6 and I'm looking for some advice about the best way of replacing or improving session variable usage. The application is in a secure extranet...
3
by: CBKowitz | last post by:
Has anyone encountered this problem? I start debugging my application and the session get reset (as far as I can tell). I then stop and restart and everything is fine. Basically the symptoms...
4
by: Jack Black | last post by:
Hi, all! Developed a basic ASP web site with MS Access 2k3 as a database back end. I've developed it on two different Win2k3 servers, and app works flawlessly on both. However, we just moved it...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.