1. Follow the previous essay, Link me, solve the problem of mobile phone-side cookies.
2. The last time the session was implemented with Cookie+redis, and the mobile browser may have a problem with the cookies, so the last cookie is taken with JS followed by the requested URL.
3. But today, a new problem has been found, JS take the cookie SessionID is empty, the situation is as follows:
(1) QQ Browser can get some cookies, and some cookies get empty, guess is backstage response Setcookie, the mobile browser is not good to accept.
(2) The UC browser is tested properly.
(3) The safari situation is the same as the QQ browser.
(4) PC side is OK.
4. In this case, I finally decided that the problem was that there was a problem with the background Setcookie the phone browser.
5. The workaround is to return the value in the cookie that needs to be present in the JSON return result.
6. Use the Setcookie method in JS to set a cookie to the browser.
7. The Setcookie method is as follows.
function Setcookie (name,value) { var days =; var New Date (); + days*24*60*60*1000); = name + "=" + Escape (value) + "; expires=" +
The cookie is returned in JSON form, using JS to set the cookie. (To resolve the phone browser is not available in the case of unknown cookie)