- Home /
Question by
mahdi68 · Aug 12, 2013 at 11:47 AM ·
www classwebservicecookiecookies
save cookie after login and use it for login again
Hi , i use this code to login webservice i want to save cookies and login to webservies without user name and password but , i dont know how to save cookies after login ! can any body help me ? thanks
void Start()
{
string urlAdress = URL;
WWWForm form1 = new WWWForm();
form1.AddField("username", "username");
form1.AddField("password", "password");
Hashtable header = new Hashtable();
header = form1.headers;
WWW www = new WWW(urlAdress, form1.data, header);
StartCoroutine(WaitForRequest(www));
}
IEnumerator WaitForRequest(WWW www)
{
yield return www;
// check for errors
if (www.error == null)
{
Debug.Log("WWW Ok!: " + www.data);
}
else
{
Debug.Log("WWW Error: " + www.error);
}
}
Comment
Perhaps http://www.thesitewizard.com/javascripts/cookies.shtml might help?
thanks my friend but it`s for web and i need do this on unity game engine
Your answer
Follow this Question
Related Questions
Flashlight Cookie Not Displaying 1 Answer
Cookie not correctly set in UnityWebRequest in 2018.3 1 Answer
UnityWebRequest and/or HttpWebRequest gives 403 on PUT 0 Answers
Workaround for SET-COOKIE bug in www.responseHeaders? 2 Answers
System cookies login application?,Cookie systeme login FPS Game 0 Answers