duandongji2231 2016-01-24 08:38
浏览 60

警告:session_start():尝试使用日语字符破坏PHP 5.4上的未初始化的会话错误

I have a standard oscommerce installation and when a session variable contains a multibyte character such as Japanese it creates the error "Warning: session_start(): Trying to destroy uninitialized session". The stack trace doesn't shed a great deal of light on what's causing the problem except that it is caused in the session class file on the following statement:

...
return session_start();

The Error is caused by a variable like this:

$shipping['method'] = {Japanese character string}

tep_start_session('shipping');

...and then the error is experienced on every subsequent page load.

Any ideas greatly appreciated!

  • 写回答

1条回答 默认 最新

  • doufei3152 2016-01-26 08:50
    关注

    This turned out to be caused by a complicated reason in oscommerce. I have noticed the same error in other international websites and therefore thought I would post the answer as there is very little information discussed elsewhere.

    Many variables are stored in sessions, which may be stored in the MySQL database.

    It is therefore critical that you change the collation of the "session" table in the MySQL database to utf8_general_ci to allow for the correct storage and retrieval of multibyte characters in the database stored sessions.

    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答