1

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 webservice to create cookies on the client machine and also retreive them directly using the webservice in PHP

macha
  • 7,337
  • 19
  • 62
  • 84

1 Answers1

1

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.

Community
  • 1
  • 1
Fanis Hatzidakis
  • 5,282
  • 1
  • 33
  • 36
  • so if we have the domain constant, would the cookie be accessible through the web services. If I am working from a single domain with constant ip 1.1.1.1, then I should be able to access the cookies right? – macha Jan 28 '11 at 19:21
  • @macha Yes. Try it and check with Firebug/HttpFox – Fanis Hatzidakis Jan 28 '11 at 21:06