Can a script called by XHR reference $_COOKIE?

Posted by Christian Mann on Stack Overflow See other posts from Stack Overflow or by Christian Mann
Published on 2010-04-11T02:36:08Z Indexed on 2010/04/11 2:43 UTC
Read the original article Hit count: 450

Quick yes/no - I'm building an AJAX application and some scripts require authentication. Can I read $_COOKIE['username'] and $_COOKIE['password'] on the server if the PHP script was called via XHR, whether that be $.get() or $.post()?

Side question: Can it also set cookies? Is that considered "good practice"?

© Stack Overflow or respective owner

Related posts about xmlhttprequest

Related posts about cookies