We have a Review System in place where I work. A manager selects an employee to review, which then sets the EmployeeID as a Session[“EmpID”] variable. Now, the manager can enter in the information for the said employee.
Our Issue:
When a manager opens another tab or window in the browser (ie. Internet Explorer), searches for a different employee, it sets Employee #2 ID as the Session[“EmpID”] variable, over-writing the first one. When the manager switches back to Employee #1 and enters information, they believe they are entering information for #1, however it enters it as #2 since they selected it last.
Does anyone have ideas to prevent this from happening?
When using tabbed browsing you actually use the same asp.net session, and therefore, if you don’t uniquely seperate one page’s cache from the others, you get the same data.
If your pages uses the session to store data, use a unique identifier (such as a GUID) as a prefix for the key. Store the guid in a hiddenfield or in the
ViewState.Maybe it’ll suffice to store the
EmpIDin the ViewState. Then Tab1 will keep it’s value even if Tab2 had another value.