zizuno 0 Junior Poster in Training

I am planning on writing a website that retrieves information from websites that require logins. Originally my intention was to AJAX most of it so I could provide the information in nearly realtime but the problem lies in browsers not allowing cross domain requests. So I considered YQL but then I can't login to the website and accept their cookies. In the end I will do a proxy connection via PHP and JSONP the data to the JavaScript.

Now what I am curious is how to manage the cookies that those remote sites give.

I was thinking of taking the cookies that were set by the remote site and storing them in a MySQL row unique to the user and come time to get the cookies use cURL to resend them from a variable that retrieved them.

Option two would be to store the cookies in a cookiejar unique to that user.

And the third option would be to send the cookies to the user and have them store the cookies. And when requests are made, the cookies are sent through the JavaScript request to the PHP page, then the PHP page relays the cookies to the remote site.

If there are any better ways to do this, please let me know. If not, which of my three ways would be the best overall?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.