I have a php script that auto submits to predefined forms. I am using Snoopy class for much of the process. Problem is some of the forms are within areas that I need to be authorized first. I have no problem with "basic authorization" and snoopy supports this. The problem is on sites that use other forms of authorization, like a cgi script that vaildates against a database. I can append the cgi links like:
login.cgi?id=userid&password=password But this just gets me into the "main" site or lounge, I still need to go to another page to get to the form to submit. Since this is a php script, it does not hold state or cookies, hence my problem.
I tried changed the form action by appending like above, but this did not work, so of course I can not submit the form as I can not authorize myself. With a browser, the sites set cookies so authorization carries over from page to page. I believe.
So my other thought was to pass the cookie info to authorize then submit the form. Snoopy does have this feature available as such, Example:
But the big question is how do I translate the cookie infomation to do this? I have the cookie's on my system gathered from using the browser. Example:
a2kref
1206
thesite.com/
0
2859538432
30859208
4000441920
29411480
*
But how do I know their naming coventions to be able to send the cookie info like the snoopy example above?
I've been reading about cookies, but could find nothing realted to this situation. The snoopy class can also send rawheaders, but I don't understand how to use it to authorize myself? Example form the readme:
$snoopy->rawheaders["Pragma"] = "no-cache";
I'm just at a loss here. Anyone have any ideas or thoughts. Or others ways I could authorize myself? any help would be greatly appreciated! Thank you.
That's an extremely tricky question. It seems the snoopy class cookie functionality is fine for PHP style name=value cookies, but that doesn't help much as the cookie you are trying to send doesn't seem to be split up into name/value pairs.
I reckon your best chance in this case would be to try the official snoopy project forum:
Ya, this has been a real pain in the you know what. But if I can do the basic authorization, seems like I should be able to do any other authorization. Seems like even though I have the cookie, I don't know how to send it back, as I don't know what or how they named the infomation, because it's on their end right? Plus I was just thinking, since it is a per "session" cookie, would it work if I re-used the same cookie information?
Any one know of anywhere I can look to try and find an anwser?
I thought about posting in the project forum, but seeing the messages are old and many with no replies, I did'nt think I'd get much of a response. I even e-mailed the author, but the reply was no help.
Yes, it is a great class! It's been very helpfull to me, very well done.
Well, I hope some one reads this and has a solution or a link that might help me. This is the last hurdle to pass to finish my project. So it's quite frustrating...
Bookmarks