title: Condition for retrieving Cookie through AJAX calls
body: <p>I'm new to the cookie. But I think I might have done some wrong with my PHP code. During login process I have a verify login script that verifies the user. And if the user passes it the script will automatically set a cookie, <code>setcookie("userid", $row["profileId"], time() + 24*3600*14);</code> and the script also redirects the user to the main page with <code>header("Location: ../../index.php");</code> As I'm looking on the network tab in Google Chrome's developer tools, I can see the cookie just for the verify script, both request cookie and response cookie. But why can't see this on all other AJAX request? I can't retrieve the cookies at all, what have I done wrong? I know I have made some common pitfall</p>
  
  <p>The only Cookie I can retrieve is the session cookie. I need the retrieve the cookie using <code>$_COOKIE</code> in php. I'm using localhost as the domain</p>