dounuogong0358 2009-01-16 04:41
浏览 31
已采纳

PHP5:一些会话文件长度为0?

I'm seeing a strange situation, that I'm trying to figure out if it's a PHP issue, file issue, or normal operation. I have some users complaining about very fast timeouts on our site (session expires?), and checking the php tmp directory, I see things like this:

-rw------- 1 www-data www-data  377 2009-01-15 22:46 sess_fc789ce04a3d54ce929a401cd33ea868
-rw------- 1 www-data www-data 1167 2009-01-15 23:21 sess_fcb67b1f44a3669d8ffee69d5fa9a2e8
-rw------- 1 www-data www-data    0 2009-01-15 23:22 sess_fe0ab79c78c612d71ecca575753afdc4
-rw------- 1 www-data www-data    0 2009-01-15 23:07 sess_fedd46db2b023215cb060d67a01d3382
-rw------- 1 www-data www-data    0 2009-01-15 23:21 sess_feec900e144c011303a9f06eb428574e
-rw------- 1 www-data www-data    0 2009-01-15 23:00 sess_ffb2ed75ca311d08e41ec69c7d708d08
-rw------- 1 www-data www-data 1142 2009-01-15 22:49 sess_ffc2c882af3b3ad39b844dc5a530dc44
-rw------- 1 www-data www-data    0 2009-01-15 22:51 sess_fffbd6f7734ce3b4ef9d8009a324a459

Is this normal behavior?

TIA Mike

  • 写回答

3条回答 默认 最新

  • dskyx46424 2009-02-08 02:50
    关注

    Two possibilities spring to mind, one is that your out of disk space in a shared hosting environment, if this is not the case then your website may be sharing its session directory with other websites that have a short timeout on their sessions.

    The gc_maxlifetime setting defaults to 1440 seconds, but if you share the same session dir with another website that has a lower setting than this then it will prematurely erase your sessions, this from the php manual:

    Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.

    so i recommend changing your session save path to a different directory that the web server will have write permissions on.

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

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器