The meaning of life is to explore the world

Some tips for cookies in web requests

Posted on By Jason Liu

Usually each web API request sends with a cookie, and the response has a new cookie that is used by next request. However if we use document.cookie to get the cookie it may not be accurate if there’re multiple requests and responses.

Possible solution:

  • Put all the response in a time order to get the latest cookie
  • Send a new request to get a new cookie