hy i am developing an application that has to connect to a webserver and download and read json format data. i am able to login in it, but whenever i try to fetch other data, it returns failure.
i tried the same thing on browser by copy-pasting the urls using get method and it works. the application uses cookies to store the data.
how can i store cookies in an android application & send them to server?
Just check android development reference: http://developer.android.com/reference/java/net/HttpURLConnection.html
There is "Sessions with Cookies" paragraph ;-)
In your connecting thread, set the cookie in your request header like this (sCookie is my static cookie String variable):
Below that, after receiving a response, get the cookie like this: