Using PHP's $_COOKIE to create cookie.txt for cURL

Posted by boogie on Stack Overflow See other posts from Stack Overflow or by boogie
Published on 2010-05-10T12:36:58Z Indexed on 2010/05/10 12:44 UTC
Read the original article Hit count: 154

Filed under:
|
|
|

Hi,

I'm running Drupal and Mediawiki on my server under the same domain. They are connected to each other with extensions/modules. Meaning if I log in to Mediawiki, it automatically logs into Drupal also.

Mediawiki has some extensions that filter the information shown on the page.

What I want to do is to show that filtered information from Mediawiki on my Drupal page. I'm trying to fetch the data with PHP cURL, but I'm not able to force it to use the login information.

How can I convert PHP's $_COOKIE into cURL cookie.txt format? I suppose after that I'm able to fetch the data from Mediawiki with the right permissions.

This is what print_r($_COOKIE) outputs:

[wiki_session] => gg05lhd6pcfs5g6iokhoo0gue7

[wikiUserName] => WikiSysop

[wikiLoggedOut] => 20100510110913

[wikiUserID] => 1

[wikiToken] => 52cdb19a7b4a43e5a2f86939e4f54941

Thanks for any help!

© Stack Overflow or respective owner

Related posts about php

Related posts about mediawiki