I have a .net application (c#) that goes something like this
public partial class _Default : System.Web.UI.Page
{
#region initial variables setup
private static exam theExam;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
string userid = Request.Querystring["user"].ToString();
theExam = new exam(userid, "some values");
}
}
// rest of code.
Now my question is, if user 105 logs in an instance of exam theExam is created and assign to the static declaration on top. If user 204 then logs in from a different computer, does the static object at the top gets the value of 204 even on user's 105's computer?
No, the static object is the same instance for everyone logged on. Also the object doesn't live on 105's computer but just on the web server ofcourse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With