tags:

views:

13

answers:

2
A: 

There are two possible issues:

  1. You can't be sure that both scripts will access same session (have same session id), actually I can bet they have separate sessions. Of course, you could enforce that by sending the session id from invoke.php to curl.php by adding an extra parameter tot the URL and then use that parameter to force the session id in curl.php

  2. Second possible issue is that the session variables are read on session_start (that's when the $_SESSION is populated), but you modify the session content after you start the session (in session.php, I assume), that's why any changes (even if the conditions on 1. will be met), will not reflect into already opened session in invoke.php. I think you should force session to close and restart it.

hpuiu
A: 

I able to solve this problem. I set curl_

setopt($ch, CURLOPT_COOKIE,session_name().'='.session_id());

to use same session id and use php's session_write_close() function to write session data.

santde