Reference: http://jingyan.baidu.com/article/aa6a2c14dae9660d4c19c425.html
Using cookies to achieve automatic login