Today, when we were dealing with session variables, we were a little dizzy with a session problem.
The error is as follows: My local machine is running normally. When other machines on the LAN access my machine, select the first category and set a session with SID as "1, go to a page and retrieve "SID" from the session to get "1 ". Then, when I select the second category, set "SID" to "2", go to another page, and then retrieve "SID" from the session ", the obtained value is still "1 ".
I started printing in the background first, but when I selected the second category, the value of "SID" is still "1 ". It seems that when the page is from servlet to jsp (the first choice for SUN Enterprise applications), the session is still the first time and has not been updated. So I added a code to prevent IE from reading the cache:
Response. setHeader ("Cache-Control", "no-store ");
Response. setHeader ("Pragma", "no-cache ");
Response. setDateHeader ("Expires", 0 );
The problem was finally solved.