dongxi1943 2010-12-26 17:28
浏览 219
已采纳

是ini_set('session.save_path','自定义路径'); 会议垃圾清洁?

Does ini_set('session.save_path', 'custom path'); effect the session garbage cleaner?

As I'm setting a custom directory for the sessions, because I've read from various php security guides, that setting a custom directory on shared hosting for sessions; can improve session security.

But the problem is I've read somewhere that PHP does/handles the session garbage cleaning only when the session_save_path is the default and not modified (ie. using a custom directory)? - is this true, if so is their a solution for this?.

(take into consideration I'm using shared hosting).

Appreciate all help!

  • 写回答

2条回答 默认 最新

  • dongsaohu6429 2010-12-26 19:45
    关注

    The garbage collector kicks in before control is handed over to your script, so when the GC kicks in, the save_path set in php.ini will be in effect, not the path you're overriding with.

    Essentially, you cannot use the default garbage collector if you override the save_path from within your scripts. The session files will be stored in the override directory, but the GC will look in the previous dir, which would now have no session files in it.

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog