0

Although i'd say i'm fairly savvy with pinging off POST & GET requests one thing i'm not too savvy with is HTTP Headers.

I'm attempting to fire some POST requests to a few scripts to try and debug them - however, I need to be logged in (within the request) for it to work.

Whats the best way to achieve this. The app's auth login is done with simple PHP sessions.

David
  • 34,836
  • 11
  • 47
  • 77

1 Answers1

1

This is broad question but here are my 2 cents.

As your tag suggests, you are already aware of cURL, so you can utilize that and look into the CURLOPT_COOKIEJAR which would help you maintain the cookie. You can just google for some code samples like for instance this one which I just found very casually

PHP, cURL post to login to WordPress

It just gives you some idea of how the script will look like.

There is another option if the application code is available to you. You can just hack in a fake valid user based on some temporary/special GET parameter that you send and you can remove/disable this code outside of production.

Community
  • 1
  • 1
Sabeen Malik
  • 10,816
  • 4
  • 33
  • 50
  • If i'm honest I don't want to write the code in PHP (even though I know I could). I'm looking for a browser extension or a native mac app that will allow me to do the same thing? – David Jul 05 '12 at 21:39
  • Could I login through the browser then stash the PHP sess id and put the in the request from the third party extension/app – David Jul 05 '12 at 21:39
  • I am honestly not aware of any extension of the sort, there may exist some but maybe u r better off asking a new question focusing on an off the shelf solution. If the session id is carried in the url it could work but most sites work with cookie sessions. – Sabeen Malik Jul 06 '12 at 04:06