Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Login to a forum with socket... can't stay logged in
I'm hoping someone can help me with this problem that has me banging my head against the keyboard.
I'm writing a script that connects via socket to a vbulletin forum, POSTS the login form, and then /should/ (once logged in) just GET a page to be parsed.
The forum seems to create a session upon your first visit to a page if you aren't logged in, so I GET the home page, snatch the session id out of it and post it with the login form just like the site does. The login is successful and the server returns the "you are logged in, you will be redirected to blah blah blah" page.
But the problem is no matter what I do after that I can't stay logged in! The site does set a sessionhash cookie and some other cookies which I AM reading and sending back to the server in my final GET request (I made sure by watching it with wireshark) but that doesn't do it...
I've compared my script's conversation with the server against the same conversation using lynx with wireshark and I can't find anything different except lynx stays logged in, and my script doesn't.
I'm wondering if anyone has any ideas. I could attach some code if necessary but I think I'm just missing something.
Thanks in advance!
0 · ·