Saving Login Status

I’m trying to access a page on a webserver that requires you to be logged in. How can I login with one form, stay logged in and allow me to submit other forms to other pages that require you to be logged in?

So the problem I have:

  • I send the login details to login.php (login successful)
  • I request details.php (uh oh, you’re not logged in)

EDIT: I don’t have access to edit / upload scripts on the server.

Any help is appreciated.

what you can do is make a filed “Action” and request everything on same php url with different action type

Like

IEnumerator login()
{ 
	      WWWForm form = new WWWForm();
	      form.AddField("Action", "Login");
          form.AddField("username", textbox1.text);
          form.AddField("password", textbox2.text);
          WWW w = new WWW(phpURL, form);
          yield return w;
          if (!string.IsNullOrEmpty(w.error))
           {
	        print(w.error);
		}
		else 
             {
		     playerpref.setstring("username",textbox1.text);
             print("login suc");
		}


}
IEnumerator request_details()
{ 
	      WWWForm form = new WWWForm();
	      form.AddField("Action", "request_details");
          form.AddField("username", playerpref.getstring("username"));
          WWW w = new WWW(phpURL, form);
          yield return w;
          if (!string.IsNullOrEmpty(w.error))
          {
	       print(w.error);
	      }
	      else
          {
           print(w.text);  
           print("do waht you want to do with data you recive here ");
	      }

}

in the php side your query will be fired according to your action type so there will be no session id issue .