Search code examples
unity-game-engineunitywebrequest

UnityWebRequest: how to get/set cookies


The links you can get on google and stackoverflow are very old (2009).

Between 2009 and today, a lot of things have been solved / improved.

So my question is: how to get/set cookies using UnityWebRequest with the latest Unity version?


Solution

  • Thanks to rider, here's my working code: in the foreach loop you can get all the values, hence I got the Set-Cookie value I needed.

    foreach (var s in www.GetResponseHeaders()) {
        Debug.Log("s=" + s);
    }