cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: handling single session between multiple executions

From: Brian Wilkins <brian_at_hcc.net>
Date: Mon, 11 Oct 2004 16:04:38 +0600

Hi,
   I actually do it differently, and curl may not be what you need. We
maintain user login/passwords in a mysql database, and use the session()
function in PHP to maintain cookie sessions. If the session is too old, then
we make them log back in. It's what most sites do, in some sort or fashion.
Even if you were able to keep the connection open, the web server most likely
would kill the connection because the TTL is not that long.

> Hello,
> I would like to handle a curl connection between multiple
> executions of my php script. For example I make a login to a private
> area (with curl) and then I wont make some action in this area. I
> would like to make just one time the login, than save the curl
> session informations in a cookie, file or php session. So I can get
> this info between multiple executions of my php script avoiding to
> make again the login.
>
> Is it possible? I've tried to store the resource returned by
> curl_init in a sessions, but, of course, this way doesn't work
> because it's a resource and not a structured variable (I've tried
> using serialize, but it's a resource and doesn't work).
>
> Could you help me?
>
> Thanks
> Tom

--
Brian Wilkins
brian_at_hcc.net
Software Engineer
Heritage Communications Corporation
  Melbourne, FL     USA     32935
Received on 2004-10-11