Problem Overview:
Through PHP Curl simulation landing a website such as Http://www.aaa.com, through the Fiddler capture Packet Analysis as follows:
1. The form is submitted to Http://www.aaa.com/dologin by post, which produces a token:xxx,
2, the server with this token to jump to the following address to log in:
https://account.usercenter.com/login?token=xxx&target_url=http://www.aaa.com
;
(Note that the domain name is different, and is HTTPS, in addition to this token-carrying URL copy to any computer can log on, the successful landing will expire)
3. Address redirected to target_url:http://www.aaa.com after successful login
Problem Analysis:
My understanding: There is a license server, any PC computer access to carry valid tokens between the URL,PC and the server through a cookie to maintain this token;
Ask questions:
How do I implement this login simulation using PHP curl?
Here's My Code:
I wonder if I can make this kind of landing through cookies? Gentlemen, please advise ~ ~
Reply content:
Problem Overview:
Through PHP Curl simulation landing a website such as Http://www.aaa.com, through the Fiddler capture Packet Analysis as follows:
1. The form is submitted to Http://www.aaa.com/dologin by post, which produces a token:xxx,
2, the server with this token to jump to the following address to log in:
https://account.usercenter.com/login?token=xxx&target_url=http://www.aaa.com
;
(Note that the domain name is different, and is HTTPS, in addition to this token-carrying URL copy to any computer can log on, the successful landing will expire)
3. Address redirected to target_url:http://www.aaa.com after successful login
Problem Analysis:
My understanding: There is a license server, any PC computer access to carry valid tokens between the URL,PC and the server through a cookie to maintain this token;
Ask questions:
How do I implement this login simulation using PHP curl?
Here's My Code:
I wonder if I can make this kind of landing through cookies? Gentlemen, please advise ~ ~
The previous code I was debugging several times how to carry a cookie, but should be always not successfully associated with the cookie file, do not know how the code to write the code to carry the cookie. But later after more debugging, found that after the Http://www.aaa.com/dologin call, has been able to log on the site, this token with the URL is just a SSO, in order to login to other sub-stations.
Thank you for your answer ~ ~
Of course you can, you understand. The cookie holds a unique token, and each time it is submitted, the token is carried, and the token is invalidated immediately upon successful login.
According to the process, it must be right.