dongmeiran609914 2012-04-06 16:54
浏览 84
已采纳

使用session_write_close()时PHP保存会话;

I've one page where i do a long polling i've to use at the begin of this page this

session_start();
session_write_close();

Because :

to prevent concurrent writes only one script may operate on a session at any time

So if i do not and the long polling is running the user will not be able to load another page.

So accessing to my data in session from this polling page is possible but at some point in my script i've to save my session back to the server because i made some change in it.

What's the way to do it?

That will be very nice it'll be a way to do something like

session_write_open();
//do stuff
session_write_close();

But the session_write_open() doesn't exist!

Thanks

  • 写回答

5条回答 默认 最新

  • duankuai6991 2012-04-06 16:57
    关注

    Before you make some change to the session, call session_start again. Make the changes, and if you still do not want to exit call session_write_close once more. You can do this as many times as you like.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数