释放双眼,带上耳机,听听看~!
客户端通过Ajax请求获得cookie,如:
$cookie = 'abcd...'; "<script> setcookie($cookie); </script>"
// 服务器端控制器 $cookie = 'abcd...'; return render(json_encode(['cookie' => $cookie])); // 客户端 <html><body><script> ajax{ success: function(data){ var cookie = data.cookie; } } </script></body></html>