After logging in via $.ajax()
to a site, I am trying to send a second $.ajax()
request to that site - but when I check the headers sent using FireB
Just my 2 cents on setting PHPSESSID cookie issue when on localhost and under dev environment. I make the AJAX call to my REST API endpoint on the locahost. Say its address is mysite.localhost/api/member/login/
(virtal host on my dev environment).
When I do this request on Postman, things go fine and PHPSESSID is set with the response.
When I request this endpoint via AJAX from the Browsersync proxied page (e.g. from 122.133.1.110:3000/test/api/login.php
in my browser address line, see the domain is different vs mysite.localhost
) PHPSESSID does not appear among cookies.
When I make this request directly from the page on the same domain (i.e. mysite.localhost/test/api/login.php
) PHPSESSID is set just fine.
So this is a cross-origin origin request cookies issue as mentioned in @flu answer above