Solved

PHP Curl session cookies problem

Posted on 2008-06-13
3
1,311 Views
Last Modified: 2011-09-20
Hello, i have problem with cURL.
i have
//through this link logging
$url1 = "http://mysite.com/login.php?username=aaaaa&password=bbbbb";

//Later parsing some info from here
$url2 = "http://mysite.com/members_area.php";

How can i make, that it login first, and it save cookies to .txt or SESSION, and when cURL goes to $url2, it keep alive that session, the one with which logged in.
0
Comment
Question by:springfresh
3 Comments
 
LVL 4

Accepted Solution

by:
afzz earned 500 total points
ID: 21780606
Try this
http://mysite.com/login.php
 
<?
session_start();
$_SESSION['username']=$_REQUEST['username'];
$_SESSION['password']=$_REQUEST['password'];
?>
 
http://mysite.com/members_area.php
 
<?
session_start();
echo $_SESSION['username'];
echo $_SESSION['password'];
 
?>

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question