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 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)