Solved

PHP Curl session cookies problem

Posted on 2008-06-13
3
1,310 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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now