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 【急】在线问答CNC雕刻机的电子电路与编程
  • ¥60 在mc68335芯片上移植ucos ii 的成功工程文件
  • ¥15 笔记本外接显示器正常,但是笔记本屏幕黑屏
  • ¥15 Python pandas
  • ¥15 蓝牙硬件,可以用哪几种方法控制手机点击和滑动
  • ¥15 生物医学数据分析。基础课程就v经常唱课程舅成牛逼
  • ¥15 云环境云开发云函数对接微信商户中的分账功能
  • ¥15 空间转录组CRAD遇到问题
  • ¥20 materialstudio计算氢键脚本问题
  • ¥15 有没有代做有偿主要做数据可视化部分即可(2023全国高考更省一本线理科类)