Do AJAX requests retain PHP Session info?

前端 未结 8 938
情书的邮戳
情书的邮戳 2020-11-28 18:52

If I had a user logged onto my site, having his id stored in $_SESSION, and from his browser he clicked a \'Save\' button which would make an AJAX request to th

8条回答
  •  青春惊慌失措
    2020-11-28 19:32

    What you're really getting at is: are cookies sent to with the AJAX request? Assuming the AJAX request is to the same domain (or within the domain constraints of the cookie), the answer is yes. So AJAX requests back to the same server do retain the same session info (assuming the called scripts issue a session_start() as per any other PHP script wanting access to session information).

提交回复
热议问题