开发者

jQuery and Uploadify session in the php file

开发者 https://www.devze.com 2023-02-14 17:19 出处:网络
Ok, so i\'ve just getting started on a v开发者_StackOverflow中文版erry new project, when this problem suddenly came up. The upload works fine, and I\'m able to move/replace and edit the filenames of t

Ok, so i've just getting started on a v开发者_StackOverflow中文版erry 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.

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 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.

Example from first link:

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

Relevant threads:

Sessions and uploadify
Uploadify not passing variables, Session problem?
jquery uploadify and codeigniter session id problem
http://www.uploadify.com/forums/discussion/43


The scriptData: attribute is your friend. Use it to pass any variables to your receiving for you might need, as your session data will not persist.

0

精彩评论

暂无评论...
验证码 换一张
取 消