Using same session ID within two PHP scripts at same time

前端 未结 2 417
一整个雨季
一整个雨季 2021-01-14 08:44

I have ocassionally detected a strange problem with PHP sessions.
When I am running two PHP scripts using SAME session ID, second script is stuck until first one is comp

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-14 08:58

    I also found quite simple solution for this problem. We can use session_write_close(); to unlock session file in script 1, then we can make any file_get_contents(), curl_exec() etc without any worries and after these operations turn session back by session_start(). Checked by myself, works as charm!

提交回复
热议问题