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

curl-and-php

Re: Using cURL to store cookie session into variable / memory

From: Waruna Geekiyanage <waruna.ns_at_gmail.com>
Date: Fri, 31 Jan 2014 07:51:53 +0530

Hi Michael Mikhjian,

This method worked for me perfectly when all the cookes from redirects
were collected and append to the cookie string.
If cookie with same name received twice, have to override the value.
Important thing is to send back all the cookies received from the domain.

Thank You,
Waruna Geekiyanage

M: +94 71 4168164
E: waruna.ns_at_gmail.com <mailto:warunans_at_gmail.com>
MSN: warunans_at_hotmail.com
GTalk: waruna.ns
ICQ: 225184383
Yahoo: warunans
Skype: warunans

On 1/31/2014 1:23 AM, MKNwebsolutions . wrote:
> Hi all,
>
> I stumbled upon an issue where I need to use object variables sessions
> to store cookies instead of on disk. I came up with a solution where
> I extract the sent cookies from the headers via regex into PHP object
> variables. I then resend those cookies using CURLOPT_COOKIE.
>
> This all works well, but not where there is header redirections
> (enabled via CURLOPT_FOLLOWLOCATION). I noticed cookies are not
> carried through this method when using this manual method.
>
> So, I ended up disabling CURLOPT_FOLLOWLOCATION and manually
> connecting each redirection page. However, this method does / does
> not work on various sites. Some sites send multiple cookies with
> various flags at those header redirects - throwing off my solution. I
> assume that using the CURLOPT_COOKIEJAR method interprets the flags
> correctly.
>
> Anyone else stumble into this issue?
> *
> *
> *
> Michael Mikhjian
> **Owner · **Senior Architect / Developer*
>
> http://mkn.us
> LinkedIn <http://www.linkedin.com/profile/view?id=7801327> · Twitter
> <https://twitter.com/#%21/MKNwebSolutions> · Facebook
> <https://www.facebook.com/MKNwebsolutions> · Youtube
> <http://www.youtube.com/user/MKNwebsolutions>
>
> Mobile: _+1 248-289-0645_ · Office: _+1 248-274-4643_
> Troy, Michigan
>
>
> /
> /Note: This e-mail transmission, including any attachments, is
> intended only for the named recipient(s) and may contain information
> that is privileged, confidential and/or exempt from disclosure under
> applicable law. If you have received this transmission in error, or
> are not the named recipient(s), please notify MKN Web Solutions
> immediately by return e-mail and permanently delete this transmission,
> including any attachments./
> /
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2014-01-31