I'm trying to use "curl" to perform article edits and saves so I can reproduce an intermittent problem. (PHP is producing hanging processes when invoking external programs via "cmd", on Windows 2003 Server.) Each time I try, I get the mediawiki error:
"Sorry! We could not process your edit due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in."
Here's what I'm trying, based on the current cookies in my browser and the form fields on the edit page. Any tips? Any better way to do this?
curl \ -c 'wikidb_vpw_UserName=Jsmith' \ -c 'wikidb_vpw_UserID=5' \ -c 'wikidb_vpw_LoggedOut=20080317144239' \ -c 'wikidb_vpw_Token=<my current token goes here>' \ -c 'wikidb_vpw__session=<my current session goes here>' \ -F 'wpTextbox1=@debug-php-hangs.txt' \ -F 'wpSection=' \ -F 'wpStarttime=20080317162446' \ -F 'wpEdittime=20080317162432' \ -F 'wpScrolltop=' \ -F 'wpSummary=bughunt' \ http://mywiki.com/w/index.php?title=mypage&action=submit
Thanks, DanB
Daniel Barrett wrote:
I'm trying to use "curl" to perform article edits and saves so I can reproduce an intermittent problem. (PHP is producing hanging processes when invoking external programs via "cmd", on Windows 2003 Server.) Each time I try, I get the mediawiki error:
"Sorry! We could not process your edit due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in."
Here's what I'm trying, based on the current cookies in my browser and the form fields on the edit page. Any tips? Any better way to do this?
Thanks, DanB
You need the edittoken. Also i think you need to specify you're saving it. wikidb_vpw_LoggedOut is unnecesary. -F 'wpEditToken=<the user's current edit token>' -F 'wpSave=Save'
You can put wpStarttime in the future to avoid problems, but will need to change wpEdittime after each succesful save (or tweak the code to skip that check ;) ).
mediawiki-l@lists.wikimedia.org