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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?