Hey all-
So let's say I'm on a page that is authenticated via CoSign on a server. I
then run a script that tries to grab the same CoSign authenticated page's
contents. When I try this, the response returns http code 302 with a redir
link. If I manually follow the link, the page loads fine. If I set the curl
option "FOLLOWTRANSFERS", I end up at a CoSign authentication page.

I assumed attaching all currently set cookies would fix the problem since
CoSign uses session cookies, but to no avail. Below is a sample of my curl
code. I know this isn't a PHP forum, but it appears to only be affecting
CoSign sites.

$fname = '/home/temp/cookies.txt';
if( $stream = fopen($fname, 'w') ) {
fwrite($stream, $_SERVER['HTTP_COOKIE']);
}

$client = curl_init();
curl_setopt($client, CURLOPT_RETURNTRANSFER, true);
curl_setopt($client, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/home/temp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/home/temp/cookies.txt');
curl_setopt($client, CURLOPT_URL, $url);
$response = curl_exec($client);
curl_close($client);

Thanks!

-- 
Brendan Dailey
ITS/SITES Print Team - Student Developer
President of the Catholic Student Association
University of Michigan
[email protected]
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Cosign-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cosign-discuss

Reply via email to