我正在尝试使用正确的 HTTP 请求和 cookie 来模拟对 hotmail.com 的登录。我正在使用 PEAR HTTP_Request2 包来处理这些 http 请求。我已成功呈现登录页面>> https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1408039901&rver=6.4.6456.0&wp=MBI&wreply=http:%2F%2Fmail.live.com %2Fdefault.aspx&lc=1033&id=64855&mkt=en-us&cbcxt=mai&snsc=1。
当我尝试登录该页面时,我再次被定向到登录页面,而所有标题都是正确的。
我使用名为 Live HTTP Headers 的 Mozilla FireFox 插件来查看发送到服务器的标头是什么。此插件显示发送到服务器的所有标头。我发现请求的 URL 发送了一个类似这样的查询字符串
login=MY_EMAIL&passwd=PASSWORD&type=11&PPFT=CvL2Pz1Eg19wqz86n6Ykvz*gM%21oIj0GIZqv6sSIxdESOf7hQ%21IrGttfCQ4Sc6zLOGU7*117q*q4z*RosEo06eHZiFo133hYWuVBPAhGm8PyBL3HGWNufBIP7LuAyNvRheFtrm2TjsH3rWhIlCM9iL4FG3fnF9Tjyg5UywlJ3UAVmeo7WXj6Rl72Ia%21B*ckAcOhueoyViNYOU9Y3mZYbQb0guyO3Nrvida3zvWzftoC6CzaXgyodtLgobNXT0Qw%21Exw%24%24&PPSX=PassportR&idsbho=1&sso=0&NewUser=1&LoginOptions=3&i1=0&i2=1&i3=24027&i4=0&i7=0&i12=1&i13=0&i14=2820&i15=18351&i17=0&i18=__Login_Strings%7C1%2C__Login_Core%7C1%2C
我花了一些时间查看呈现的页面,发现这些查询字符串是由页面加载的 Javascript 添加的,直到我没有在电子邮件和密码旁边发送正确的查询字符串,我将无法登录这页纸。
我想出了其中一些查询字符串
type (Always constant)
PPFT (Comes from variable ServerData)
PPSX (could not figure out)
idshbo (Always constant)
sso (Always constant)
NewUser (Always constant)
LoginOptions (Always constant)
i1 (Always constant)
i2 (Always constant)
i3 (could not figure out)
i4 (Always constant)
i7 (Always contant)
i12 (Always constant)
i13 (Always constant)
i14 (could not figure out)
i15 (could not figure out)
i17 (Always constant)
i18 (Always constant)
这些查询字符串是从以下.js 脚本生成的
我不确定我所做的是否正确。有没有替代方法?我有两天的时间到达这里,但现在我被困住了。