开发者

Can I restore a PHP SESSION by its ID?

开发者 https://www.devze.com 2023-02-18 04:06 出处:网络
Im uploading files with the uploadify plugin. the PHP SESSION is lost durin开发者_StackOverflow中文版g upload, is there a way to restore the session?

Im uploading files with the uploadify plugin. the PHP SESSION is lost durin开发者_StackOverflow中文版g upload, is there a way to restore the session? Perhaps by its id?


Yes. You need to add an option to uploadify:

$('#upload').uploadify({
    'scriptData':{'session_name':"<?php echo session_id(); ?>"}
});

And you need to add this to your PHP:

<?php
session_id($_POST['session_name']);
session_start();
?>

Then everything will be as expected.

0

精彩评论

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