Solved

PHP Curl session cookies problem

Posted on 2008-06-13
3
1,314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

734 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