Help needed in Perl LWP module

Hi,

I've a issue in writing a perl script that will automatically monitor the site availability.
There are two different cookies are set in two consecutive flows to a URL and this second cookie has to be passed to the third step which actually gives permission to access based upon the cookie.

cookies set in the Ist flow by the site:
Set-Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Set-Cookie: sessionid=0001DCQZ0CCCDWPCT0T43FPXH2Y;Path=/; Secure

cookies sent in the Ist flow by the script:
Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Cookie2: $Version="1"

cookies set in the second flow by the site:
Set-Cookie: CRED=xFD0kq+lt8Q/SUFQbUwqvhDynTpSW2/t4F6JHEoeyUZ23Cll+fEAJfGE9Bq4rrLDvbsquY4Ox/5GFiVrOOp3ZzEAVRfy9UZSFaH1x8yipP0=;path=/; domain=.xxx.com; secure

Cookies sent in second flow by the script:
Cookie: SaneID=xyz-xyz; path=/; expires=Wed, 04-Oct-11 13:31:58 GMT; domain=.xxx.com
Cookie2: $Version="1"

My question is why is the latest cookie namely CRED not sent in the second flow?

The code related my cookie is
$cookie_jar = HTTP::Cookies->new();

$cookie_jar->add_cookie_header($request);
$response = $useragent->request($request);
$cookie_jar->extract_cookies($response);

Can anyone please help me?

Thanks. :o

But there is no expiration date for the cookie. So it's a session cookie. Session cookies are not normally saved to any cookie jars, because they are by definition valid for the current "session" only, and no persistence is needed. This really depends on how you write your script.