Sign in to follow this  
Followers 0
fielmann

Howto POST to my webserver with PHPSESSID

8 posts in this topic

Hello autoit-friends!

I'd like to send the folowing POST command to my webserver:

--------------------------------------------

POST /login.php?sid=d620b0ae8c1e8ac0f1155b7dddf054a1 HTTP/1.1

Host: www.mywebserver.com

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://www.mywebserver.com/

Cookie: Logindata=myuser%B41; PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1

Content-Type: application/x-www-form-urlencoded

Content-Length: 113

PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1&login_name=myuser&login_password=12345&Submit=enter+webserver

--------------------------------------------

Howto send the POST with included PHPSESSID ? :D

Share this post


Link to post
Share on other sites



Would you like me to turn your sheets for you too?

Try adding another SetRequestHeader:

$oHTTP.SetRequestHeader("Cookie", "PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")

Or maybe you can modify the Send string:

$oHTTP.Send("fname=john&lname=smith&PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")

Share this post


Link to post
Share on other sites

Would you like me to turn your sheets for you too?

Try adding another SetRequestHeader:

$oHTTP.SetRequestHeader("Cookie", "PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")

Or maybe you can modify the Send string:

$oHTTP.Send("fname=john&lname=smith&PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1")

How to get the name of the "Cookie" ?

Is there any tool that I can catch all needed information for winhttprequest? :D

Share this post


Link to post
Share on other sites

How to get the name of the "Cookie" ?

Is there any tool that I can catch all needed information for winhttprequest? :D

Yes. I use a plugin for Firefox called livehttpheaders which captures the POST every time you submit a form.

http://livehttpheaders.mozdev.org/

Share this post


Link to post
Share on other sites

Yes. I use a plugin for Firefox called livehttpheaders which captures the POST every time you submit a form.

http://livehttpheaders.mozdev.org/

OK, I've downloaded and installed the tool.

Here is what I captured:

POST /login.php?sid=d620b0ae8c1e8ac0f1155b7dddf054a1 HTTP/1.1

Host: www.mywebserver.com

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://www.mywebserver.com/

Cookie: Logindata=myuser%B41; PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1

Content-Type: application/x-www-form-urlencoded

Content-Length: 113

PHPSESSID=d620b0ae8c1e8ac0f1155b7dddf054a1&login_name=myuser&login_password=12345&Submit=enter+webserver

How to bring this into htttprequest for autoit? :D

Share this post


Link to post
Share on other sites

I already showed you. The header is on the left side and the value is on the right. You add all required headers.

#511905

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0