Home  >  Article  >  php教程  >  php中kindeditor多图上传session丢失问题解决

php中kindeditor多图上传session丢失问题解决

WBOY
WBOYOriginal
2016-07-06 13:34:241649browse

session丢失很奇怪了经常会有碰到过小编碰到一个session丢失问题到现在还没有解决了,今天碰到了kindeditor多图上传session丢失问题了一起来看解决方案。

<script>ec(2);</script>

解决办法:

1.在创建文本编辑器时增加session_id的传递

<script><br /> var editor;<br /> KindEditor.ready(function(K) {<br /> editor = K.create('textarea[name="content"]', {<br /> allowFileManager : true,<br /> extraFileUploadParams:{<br /> 'PHPSESSID' : "<?=session_id()?>"<br /> }<br /> });<br /> </script>

2.upload_json.php文件增加session初始化

$session=isset($_POST['PHPSESSID'])?$_POST['PHPSESSID']:'';

if($session){//重新设置cookie,解决使用Flash上传图片时cookie丢失的问题

    session_id($session);

    session_start();

}else{
    session_start();
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn