开发者

HTTP: an API documentation says I must "store a cookie", do I need to send it during next request?

开发者 https://www.devze.com 2023-01-19 20:40 出处:网络
I have little experience with web programming and I am implementing an interface where I sent a HTTPS POST Request (with user/password), receive a XML, then I send another HTTPS POST Request (with an

I have little experience with web programming and I am implementing an interface where I sent a HTTPS POST Request (with user/password), receive a XML, then I send another HTTPS POST Request (with an additional "passcode" dependent on the XML), receive a XML, (then I am logged in) then I send a HTTPS GET request and get an XML (the data I actually want).

The docume开发者_如何学Gontation says: The following cookies are sent to the application ... and then it says: "the application must be able to store cookies".

I wondered why I should store cookies if I am never asked for it. I just started programming that protocol but I saw in a response that I was sent a cookie. Now I wondered whether I need to store the cookie (and worry about it) if I am never asked for it?


I wondered why I should store cookies if I am never asked for it.

Asked by who? User? User should not care. Cookies are part of protocol that you must implement to be able to communicate with that server.

That protocol spec says that you should store cookies - where you like, and send with each request.

0

精彩评论

暂无评论...
验证码 换一张
取 消