Can we create cookies from webservices in PHP
Hello I am trying to find out if we can create cookies from webservices. I am in a unique situation where my webservice and database server would be at a remote location. And the client would be making ajax calls to the webservice to get and put data. Now one question I have is, if we can use the webservic开发者_运维知识库e to create cookies on the client machine and also retreive them directly using the webservice in PHP
Ajax calls to the webservice are really originating from the client itself, so the web service can set/read cookies as long as the domains match.
You can test it with a packet snooper, in its simplest form the extensions Firebug and HttpFox for Firefox will work. They will let you see how the ajax requests happen and what HTTP headers (including cookies) are sent to your webservice.
精彩评论