swfupload会话问题破坏会话

时间:2011-01-10 10:52:05

标签: php session swfupload

我遇到swfupload问题。我像这样传递session_id()

注意:它在我的本地机器上工作正常,使用MAMP。但它不在服务器上工作

  /upload-file.php?s='<?php echo session_id()';
  /upload-file.php?s=189477fcfa1ec7f630e70a09e1e84cae

但是它不维护会话并且破坏我当前的会话(退出我)这里是文件上传中的代码。

<?php

 if(isset($_GET['s'])) {

session_id($_GET['s']);
session_start();

    require_once 'admin/class/user.php';

    $u = new User();

    //Check for user logged in

    if($u->islogged() == FALSE) {

      header("location: index.php");

   exit();

    code continue ..... 
 }

因为我没有登录服务器将我重定向到index.php

这是swfupload调试器窗口输出

 SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
 SWF DEBUG: 
 SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg
 SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
 SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
 SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
 SWF DEBUG: StartUpload: First file in queue
 SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
 SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to /upload-file.php?s='189477fcfa1ec7f630e70a09e1e84cae' for File ID:  SWFUpload_0_0
 SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
 SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 317793. Total: 317793
 SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 302.
 SWF DEBUG: Event: uploadComplete : Upload cycle complete.
 SWF DEBUG: StartUpload: First file in queue
 SWF DEBUG: StartUpload(): No files found in the queue.

1 个答案:

答案 0 :(得分:0)

在你的swfupload js中试试这个:

  var swf;
  window.onload = function () {
   swf = new SWFUpload({
    // Backend Settings
    post_params: {"PHPSESSID": "<?php echo session_id(); ?>"}
...