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?
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?
You can use SetRequestHeader and GetRequestHeader/GetResponseHeader to set and get cookies on your WebRequest.
//the key is case sensitive
UnityWebRequest.SetRequestHeader("Cookie", "Delicious cookies");
UnityWebRequest.GetRequestHeader("Cookie");
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);
}