Session loss is very strange. I often encounter a session loss problem that has not been solved yet. Today, I encountered a session loss problem when uploading multiple pictures in kindeditor. Let’s take a look at the solution.
Solution:
1. Add session_id when creating a text editor
<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>
});</p>
</script>
2.upload_json.php file adds session initialization
$session=isset($_POST['PHPSESSID'])?$_POST['PHPSESSID']:'';
if($session){//Reset cookies to solve the problem of cookie loss when uploading images using Flash
session_id($session);
session_start();
}else{
Session_start();