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

curl-and-php

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

From: MKNwebsolutions . <michael_at_mknwebsolutions.com>
Date: Thu, 30 Jan 2014 21:23:46 -0500

Thanks Waruna.

You're correct, the method does work. I solved it shortly afterwards, I
tried to remove my post from here but it seems it did not go through.

Solution @
http://stackoverflow.com/questions/21442976/php-using-curl-to-store-cookie-session-into-variable-memory

*Michael Mikhjian **Owner · **Senior Architect / Developer*

http://mkn.us
LinkedIn <http://www.linkedin.com/profile/view?id=7801327> ·
Twitter<https://twitter.com/#!/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. *

On Thu, Jan 30, 2014 at 9:21 PM, Waruna Geekiyanage <waruna.ns_at_gmail.com>wrote:

> 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 <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 <%2B1%20248-289-0645>* · Office: *+1
> 248-274-4643 <%2B1%20248-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