<?php 
header("Access-Control-Allow-Origin: *");
?>
<script>
    const xsrfToken = document.cookie.split('; ').find(row => row.startsWith('XSRF-TOKEN=')).split('=')[1];
    if (xsrfToken) {
        document.write(xsrfToken);
        if (window.opener) {
  window.opener.postMessage({xsrfToken}, "*");
}
    } else {
        document.write('Token not found');
    }
</script>