Php 在xhr.Send()post中发送$\会话['id']

Php 在xhr.Send()post中发送$\会话['id'],php,ajax,session,Php,Ajax,Session,我有输入类型number和select以及id matiere,在我的ajax方法中,在input number fire函数中输入oninput,使用一个值matiere就可以了 <label>Niveau:</label> <input type="number" oninput ="go()" id="nivo" name="nivo" max="4" min="1" required autocomplete="off" maxlength="23"

我有输入类型number和select以及id matiere,在我的ajax方法中,在input number fire函数中输入oninput,使用一个值matiere就可以了

 <label>Niveau:</label>
 <input type="number" oninput ="go()" id="nivo" name="nivo" max="4" min="1" required autocomplete="off"  maxlength="23" />

  <label>Matière</label>
  <select name="matiere" id="matiere" >

感谢您的帮助

如果您正在查找会话标识符,通常您会查看PHPSESSID,除非您提供了自定义名称cookie或查询参数。您可以通过以下方式获取它:

function getCookie(name)
{
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;
}
然后调用var session_id=getCookie'PHPSESSID'

如果Cookie被禁用,您可以通过


现在,如果您实际上正在查找会话属性,则只能在服务器端执行此操作,除非您在从服务器发送响应时选择将此属性粘贴到请求URL的cookie或param中。

您启动了会话吗?你的问题不清楚,我开始上课了
function getCookie(name)
{
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;
}