Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1319
  • Last Modified:

PHP Curl session cookies problem

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
springfresh
Asked:
springfresh
1 Solution
 
afzzCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now