Reputation: 820
I am developing a Web Application that allows multiple user access on it.
And in the code behind I am using a property in which i am saving some personal details of the user.
My question is, if I made those properties as static will be there any conflict in data saving in the property when multiple user doing the same thing.
Upvotes: 2
Views: 233
Reputation: 26209
static memebers are maintained only one copy which is common for all the users who see it, hence it's not good to use when you wnat to maintain it for multiple users.
Upvotes: 0
Reputation: 978
There will be issues if multiple people are using simultaneously and if he app is deployed.
Upvotes: 2
Reputation: 17600
Do not do that. Static values are shared between user sessions so you would override those values for each different user.
Use Session
or Cookies
to store data for specific user.
Upvotes: 7