cURL / Mailing Lists / curl-library / Single Mail

curl-library

Cookie database query mid-session

From: Bradley T Files <bfiles_at_rocsoft.com>
Date: Fri, 28 Jan 2005 14:01:01 -0500

What's the best way to query cookie values in the middle of a session?

I'm logging in to a site which sets a cookie value. I want to read that
cookie value before the session ends. (The real objective here is
knowing whether I successfully logged in or not. Right now I look for
return codes - 302 means success since I'm redirected to the home page.
200 - means failure because I receive the login failure page. But I am
told the proper way to know I'm logged in is to check for the existence
of "FUNNYNAME" cookie.)

I suppose I could set the CURLOPT_HEADER and CURLOPT_WRITEFUNCTION and
try to pull it out of the returned stream after logging in but that
seems a like a bit of overkill to me. I simply want to query the
session for the existence/value of a cookie.

Always looking for the easy way...

Thanks in advance,
Brad
Received on 2005-01-28