Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Curl, cron and php sessions

1 view
Skip to first unread message

reto

unread,
Oct 12, 2009, 12:26:37 PM10/12/09
to
Hi
I'm very new to curl but I couldn't find an answer to my question
anywhere.

I'm trying to code a cron job that goes to a php page but the page
checks if the session is auhtorized like this:

if ($_SESSION['auth'] != "yes")
{
header("Location: index.php");
exit();
}

the other file looks like this at the moment

$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,"page_link");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_exec($ch);
curl_close($ch);

which obviously doesn't work. I tried to add:
curl_setopt($ch, CURLOPT_COOKIE, "auth=yes");
but that didn't help.

How can I set my session variable so that it's passed in the curl?
I'm glad for any help, pointers.
thanks


0 new messages