elliott.david 2016-03-24 18:45 采纳率: 25%
浏览 3

阻止会话存储

We make usage of Guzzle HTTP in order to make HTTP(s) request in order to generate a CSV file; Another component that we use is the $_SESSION variable to store status information about the generation of the different files.

The main problem with this approach is that PHP blocks all other requests that make usage of the $_SESSION variable. We know that we can defeat this "problem" with a certain function that is called session_write_close();

But we still need to be able to update the information and store it in the $_SESSION variable later on and we should also be able to use the $_SESSION information in other sections of the site; Thus it should be "synced".

  • 写回答

3条回答 默认 最新

  • weixin_33712987 2016-03-24 18:51
    关注

    Sadly session_write_close is exactly what you would need to use in order to make sure the request is not blocking. My suggestion is to get and set all the session information you need at the start of the script, before you start to generate your CSV. Then call session_write_close and continue with creating your CSV file.

    评论

报告相同问题?

悬赏问题

  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题