Why do we call session_start() before any other content in the web page?
问题 I want to know why do we call session_start() before any other content in the web page? 回答1: Let me try to describe, how HTTP protocol works. Request from browser looks like this: GET /somefolder/somescript.php HTTP/1.1 Host: www.yourhost.com Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Your_Useragent Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp;q=0.8 Referer: http://testreferer.com/ Accept-Encoding: gzip, deflate, sdch,