php中kindeditor多图上传session丢失问题解决
解决办法:
1.在创建文本编辑器时增加session_id的传递
- <script>
- var editor;
- KindEditor.ready(function(K) {
- editor = K.create('textarea[name="content"]', {
- allowFileManager : true,
- extraFileUploadParams:{
- 'PHPSESSID' : "<?=session_id()?>"
- }
- });
- </script>
- <textarea name="content" >KindEditor</textarea>
2.upload_json.php文件增加session初始化
- $session=isset($_POST['PHPSESSID'])?$_POST['PHPSESSID']:'';
- if($session){//重新设置cookie,解决使用Flash上传图片时cookie丢失的问题
- session_id($session);
- session_start();
- }else{
- session_start();
- }