A very strange session problem .. PHPcodesession_start (); $ op @ $ _ GET [op]; if ($ op1) {for ($ i0; $ I & lt; 20; $ I ++) {echo $ I; sleep (1);} exit (end);} elsei is a very strange session problem ..
PHP code
// Session_start (); $ op = @ $ _ GET ['OP']; if ($ op = '1') {for ($ I = 0; $ I <= 20; $ I ++) {echo $ I; sleep (1);} exit ('end');} elseif ($ op = '2 ') {echo $ op;} 1. when $ op = 1 is accessed in the browser, the program runs for 20 seconds. 2. when $ op = 2 is accessed in the browser, the program is executed immediately. 3. when session_start (); is used, operations 1 and 2 are repeated, and operations 2 are executed after 1 is executed. 4. use session_start () to operate 1 and 2 in two browsers, and the execution ends immediately. What do session_start () locks?
------ Solution --------------------
How did you open your two browsers?
If it is generated by two tabs or by creating a window through the menu, there will be what you said.
You can add
Echo session_id ();
To observe and determine whether session_start () locks.