dongyan1993 2016-09-22 21:45
浏览 73
已采纳

类'SessionHandler'找不到PHP 5.3.3

I am having big issues implementing SessionHandler class on my app.

Unfortunately, I am stuck on 5.3.3 version and I can't upgrade to a newer version, because our server has to use that version.

Is there any alternative solution to implement SessionHandler class?

By looking into documentation, SessionHandler requires min 5.4 version.

Thanks.

  • 写回答

1条回答 默认 最新

  • douwaif22244 2016-09-22 22:00
    关注

    Right, the SessionHandler interface was not implemented in PHP until PHP 5.4. Unfortunately, PHP 5.3 reached its end of life over 2 years ago. If you're using anything prior to PHP 5.6.0, right now, you're using a version of PHP that will no longer receive updates or support. So you will not be able to take advantage of such new features that newer and current versions of PHP have to offer.

    The SessionHandler interface is the only interface exposed to userland PHP that allows you to hook directly int PHP's session handler. Prior to that you had to write your own custom session handling code as a C extension to register it as one of the session_save_handlers that PHP would use to handle sessions.

    Since you have no direct interface you're forced to do this type of thing ad-hoc in your unsupported version of PHP. i.e. by reading directly from your session storage, deserializing it manually, writing your own wrappers, and then serializing and writing back out to your storage location.

    This means you would not be able to take advantage of any of PHP's built-in features to rely on doing so, such as session_start(), session_write_close(), or the $_SESSION super global variable. You will have to wrap all of these things in your own PHP code and will be forced to call on your own PHP abstraction throughout your application code to deal with the session calls for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码