zend框架丢失会话 [英] zend framework losing session

查看:194
本文介绍了zend框架丢失会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的Zend框架应用程序中实现一个Flash上​​传器,但是我遇到了会话问题。

Flash不发送任何cookie标题,这就是会话丢失的原因。我试图发送sessionId作为后param,并在我的引导文件中,我添加了一个session_id($ _ POST ['session_id]),但这个似乎似乎工作。

我正在使用一个MySQL表作为会话存储



我尝试调试错误,并据我所知,设置了session_id,存储返回来自corect的数据数据库,但它似乎没有正确设置$ _SESSION全球。



甚至陌生人似乎在我的Windows计算机上工作,但不是在Linux分期服务器。

解决方案


$ b是否知道您是否在使用Suhosin进行PHP安装? $ b

我听说Suhosin在这个会议上做了一个一些报告,解决方案是在php.ini中禁用 suhosin.session.cryptua

无论如何,如果这不是你的问题,只是为了确保基本s:


  1. 确保你从你的帖子中传递了你的 session_id()例如,使用 SWF上传的Flash,通过将它传递到 post_params 配置数组的值。
  2. 请务必在 session_start()
  3. 之前调用 session_id($ _ POST ['session_id]) b $ b

但是无论如何,这可能与您的PHP安装有关,如果您说它在您的Windows环境下工作。


I am trying to implement a Flash uploader in my Zend framework application but I am having problems with the session.

The Flash does not send any cookie headers and this is why the session is lost. I am trying to send the sessionId as a post param and in my bootstrap file I added a session_id($_POST['session_id]) but this doenst seem to work.

I am using a MySQL table as session storage

I tryed to debug the error and as far as I see, the session_id is set, and the storage returns the corect data from the database but it doesn't seem to be set correctly in the $_SESSION global.

And even stranger it seems to work on my Windows computer but not on the Linux staging server.

解决方案

Do you know if you are using Suhosin with your PHP installation?

I've heard a few reports of Suhosin doing this to the sessions, solution in this case is to disable suhosin.session.cryptua in php.ini.

Anyway, if that's not your problem, just to be sure with the basics:

  1. Make sure you pass your session_id() in a post from your Flash, for example, with SWF Upload, this is done by passing it in the post_params value of the configuration array.
  2. Make sure you call session_id($_POST['session_id]) before session_start()

But anyway, it is probably related to your PHP installation if you are saying it works under your Windows environment.

这篇关于zend框架丢失会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆