Login Authentication and Static Variables - little confusion
Posted: Tue Jun 01, 2010 6:19 pm
Am doing login authentication using ASP.NET C#. Am using dual technologies for logging in, cookies and sessions, both for different situations.
But keeping focus at the question, suppose I've made a class having a static string variable to be accessed from any page. That sounds simple and easy, good.
Now, suppose the site is live. And userA accesses the page first, the static variable will be set according to the calculations as performed and will contain some value.
The real question is, what will happen when userB will come. Will the same system will work for him from very start or will he get the static value set as did by userA.
I'd like it not to set and ...... I've been messing since morning to see the perfect solutions. There are alternates but I thought to ask this and if static variable will be working and loading as new empty variable for every new visitor. Then it'd be great to manage things easily.
Please let me know, thank you.
But keeping focus at the question, suppose I've made a class having a static string variable to be accessed from any page. That sounds simple and easy, good.
Now, suppose the site is live. And userA accesses the page first, the static variable will be set according to the calculations as performed and will contain some value.
The real question is, what will happen when userB will come. Will the same system will work for him from very start or will he get the static value set as did by userA.
I'd like it not to set and ...... I've been messing since morning to see the perfect solutions. There are alternates but I thought to ask this and if static variable will be working and loading as new empty variable for every new visitor. Then it'd be great to manage things easily.
Please let me know, thank you.