开发者

Why php doesn't see the $_SESSION[] array anywhere?

I'm writing a php code processing a lot of data, sometimes interactively. In my starting php page i call the function session_start() before sending any other data to the browser. Then, i put some data into the $_SESSION[] array, like this:

$_SESSION['something'] = $variable;

After, there is a form, what is sent via GET and XMLHttpRequest.

getrequest.open("GET", "data_processing.php?var="+onevalue+"&another_var="+twovalue, true)
getrequest.send(null)

Another php script recieves the user data from this GET, and there i'd like to us开发者_如何转开发e the data stored in $_SESSION as well. But $_SESSION seems to be empty. I've never used sessions, what is the correct way to make available variables to consequent php scripts?


Are you sure you called session_start first?

See: http://php.net/manual/en/function.session-start.php


I finally found the solution: another script still used the session, so i had to insert session_write_close(); then it works fine. Thank you for all the answers!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜