Setting cookies when php is accessed by android app
<p>(I'm asking this partly for learning purposes, I realize what I'm trying to do might be entirely wrong!)</p>

<p>I have a php file on my website that handles log in and sets a cookie for the user if log in is successful. if setcookie() fails, I error out instead of displaying the rest of the page.</p>

<p>When I try to access this page using my android app (which uses HttpURLConnection with POST), the setcookie() fails. I'm guessing this is because the client isn't a browser and can't handle cookies.</p>

<p>so first of all, is there away for my app to be able to receive cookies from the server and store them? if not, how do you handle maintaining a login session with the user so you dont have to send a username and password, every time you want to access data from the server?</p>

<p>THanks</p>
