Can static varible cross session

A

ad

I define a static variable, like myClass.aString.
If one user in a session update the value of myClass.aString.
Can the other users in other sessions can see this change?
 
B

Brock Allen

Yes, static variables are shared throughout the application. It's like a
global variable in a sense that's simply contained within the class.
 
L

Leonid Finis

Be carefull with synchronization - if you leave shared state unsynchronized
it's dangerous, if you synchrnonize it - it degrades performance and in the
worst case can result in a deadlock.
 
E

Elton Wang

In order to let other users to share data in same
application, you should use ApplicationState rather than
SessionState to store the data.

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top