UnityWebRequest works fine until second start of unity

Hi Forum,
I’m experiencing strange behaviour with a UnityWebRequest. When I start the game the first time after Unity launched, it returns the expected string, also when called several times - when it’s still the first gamestart. When the game is stopped and restarted, the string is empty.

What’s wrong? Or is this a reproducable bug? (Version 2018.4.1f1)

Any help appreciated, I attached the code:

using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class GameServer : MonoBehaviour{

    protected string url = "http://words.lkl/whatword-server/";
    protected string noCacheUrl;
    protected WWWForm postData;
    protected string result = "";
    protected ServerCallback callback;

    public WWWForm PostData { set { this.postData = value; } }
    public string Url { set { this.url = value; } }
    public string Result { get { return result; } }

    public ServerCallback Callback { set { callback = value; } }

    public void Start()
        postData = new WWWForm();

    public void StartRequest(WWWForm newPostData = null, bool json = false) 
        noCacheUrl = url + "?t=" + GL.getUTCTime();
        if (null != newPostData) PostData = newPostData;


    public IEnumerator PostRequest()
        UnityWebRequest webRequest = UnityWebRequest.Post(noCacheUrl, this.postData);
            // Request and wait for the desired page. 
            yield return webRequest.SendWebRequest();

            string[] pages = this.url.Split('/');
            int page = pages.Length - 1;

            if (webRequest.isNetworkError)
                Debug.Log(pages[page] + ": Error: " + webRequest.error);
                // receive Datastring
                this.result = webRequest.downloadHandler.text;
// AT this point the string is empty in case of error, so no need to check in the callback

    public delegate void ServerCallback(string wwwResult);


I found the cause and could fix it.
UnityWebRequest reused the PHP session cookie from the server I connected to even after stopping and restarting the game. Doing a


when the url for the server connection is set ended up in successfull requests again.
I think to keep a session cookie over lifetime of the game might be unwanted behaviour.

What do others think. Is this a bug?

Just use using() statement for your UnityWebRequest operation. verify below link