Urgent: why can't I get JSessionID if I use snoopy to capture the EMS verification code and remotely simulate the query ticket number? Member life169 previously posted an article in the PHP forum called (capture the EMS verification code with snoopy, remotely simulate the query order number, and obtain the query result) link: topic. csdn. netu2010071523d58f2006-40ea-4cab-82e3-3bbcf4cd1e9f urgent: with snoopy capture EMS verification code, remote simulation query ticket number, can't get JSessionID problem?
Member life169 has published an article in the PHP forum called (
Capture the EMS verification code with snoopy, remotely simulate the query order number, and obtain the query result)
Link: http://topic.csdn.net/u/20100715/23/d58f2006-40ea-4cab-82e3-3bbcf4cd1e9f.html
However, I encountered a problem during the test. JsessionID is often not available,
Session_start ();
Include ("Snoopy. class. php ");
$ Url = "http://www. EMS .com.cn/qcgzOutQueryNewAction.do? ReqCode = gotoSearch ";
$ Url2 = "http://www. EMS .com.cn/qcgzOutQueryNewAction.do ";
$ Snoopy = new Snoopy;
$ Snoopy-> fetch ($ url); // get all content
Print_r ($ snoopy-> headers );
Print header information. the returned result is:
Array ([0] => HTTP/1.1 200 OK [1] => Content-Type: text/html; charset = GB2312 [2] => X-Powered-: servlet/2.4 JSP/2.0 [3] => Accept-Ranges: bytes [4] => Connection: close [5] => Date: Tue, 15 Mar 2011 11:24:53 GMT [6] => Age: 1876 [7] => Content-Length: 22804)
The correct response information should be:
Array ([0] => HTTP/1.1 200 OK [1] => Cache-Control: no-cache = "set-cookie" [2] => Connection: close [3] => Date: Fri, 11 Mar 2011 07:42:04 GMT [4] => Content-Type: text/html; charset = GB2312 [5] => Set-Cookie: JSESSIONID = n5sms1dmw1wy8lj48z1zhp1p2ks1gsgy5twtnxcyz1mvgyzk0scsi! 195316506; path =/[6] => X-Powered-By: Servlet/2.4 JSP/2.0)
The JSESSIONID is not returned in the previous response. as a result, the query results cannot be returned in the subsequent query. I have been searching for a large amount of data online for two days, but I still have no clue, now there is a strange phenomenon, if you open EMS in the browser. the php page. after refreshing the page for a while, the correct headers information will be returned. However, after a while, it cannot be returned correctly. Why does this happen, hope you can help me see what's going on? Urgent
------ Solution --------------------
Well, here we go.
Http://download.csdn.net/source/3100240