1

i have a login page where i retrieve the name of employee from database as

Session["Emp_Name"] = ds.Tables[0].Rows[0]["Emp_Mas_Name"].ToString()

after that i assign it to a string variable in my master page as

string Emp_Name = Session["Emp_Name"].ToString();

and i use that variable in aspx page to display the name as

<%=Emp_Name%>

it works fine in localhost but when it's on a live server it sometimes it shows another employee name who logged in at the same time in different systems.

please guide me to resolve this problem, thank you very much

Andrew Whitaker
  • 124,656
  • 32
  • 289
  • 307
Tufan Chand
  • 692
  • 4
  • 19
  • 36

1 Answers1

1

Session in asp.net is a classic problem, but in your case i assume that it is not the actual problem.

This problem may occurs due to

  • You have declared the string variable globally
  • You have declared the string Emp_Name as static