2014-06-26 14:29 浏览 53

PHP中的Session Time Out是否有任何事件

I'm using a web services and service's results carry a large data, so I save the Xml datas in FTP with a sesssion ID, but I want to do that when session timed out,check the Session's ID and delete Xml file in ftp. Is there anyway?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答 默认 最新

  • 已采纳
    dtla92562 dtla92562 2014-06-26 14:33

    With standard PHP sessions, there's no way to track when a particular session expires. the garbage collector has a random chance of being executed during EVERY invocation of a php script, and it will not report what it's doing, or what sessions were pruned.

    If you want to track which sessions were expired and do extra cleanup when that happens, you'll have to roll your own session handler: session_set_save_handler()

    点赞 评论 复制链接分享