php文件中的jQuery和Uploadify会话 [英] jQuery and Uploadify session in the php file

查看:71
本文介绍了php文件中的jQuery和Uploadify会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我刚刚开始了一个非常新的项目,当这个问题突然出现时。上传工作正常,我可以移动/替换和编辑已上传图片的文件名。

Ok, so i've just getting started on a verry new project, when this problem suddenly came up. The upload works fine, and I'm able to move/replace and edit the filenames of the pictures that has been uploaded.

但是,当我尝试分配变量时对于以用户身份登录时已创建的会话,它不会显示。看起来没有创建会话,为什么这不起作用?也许我错了,但是如何使用Uploadify将会话从A点转移到B?看起来使用基本的AJAX调用(jQuery)没有问题但是如果我使用Uploadify它就不会工作。

But, when i try to assign a variable to a session, that already has been created when you login as a user, it doesn't show. It looks like the sessions is not created, how come this is not working? Maybe I've got this all wrong, but how can i transfer sessions from point A to B with Uploadify? Looks like there is no problems doing this with basic AJAX calls (jQuery) but if i use Uploadify it wont work.

推荐答案

Uploadify不保留浏览器cookie,因为它使用flash上​​传文件。最简单的解决方案是在POST中传递会话ID,然后使用它来查找会话。

Uploadify doesn't preserve the browser cookies because it uses flash to upload the file. The easiest solution is to pass the session id in POST, then use it to lookup the session.

来自第一个链接的示例:

$_COOKIE['PHPSESSID'] = $_POST['PHPSESSID'];
session_start();

相关主题

会话和上传

上传不传递变量,会话问题?

jquery uploadify和codeigniter会话ID问题

http://www.uploadify.com/forums/discussion/43

这篇关于php文件中的jQuery和Uploadify会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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