Reputation: 117
I'm working on an android application which logs into a website. Basically I have managed to login within Activity A. The user is then redirected to activity B, I want to maintain that logged in session while in activity B. In order to achieve this I have tried this:
Document postLogin = Jsoup.connect("http://forums.d2jsp.org/")
.cookie("sid", sidDetails.getSid())
.post();
As you can see i'm trying to POST the cookie SID. This obviously isn't working, so does anyone have any ideas on how to achieve this? It should be noted I am using JSOUP.
Upvotes: 0
Views: 392
Reputation: 10522
There's not really enough here to go on. You need to figure out what the site is using to maintain login state, and make sure you're setting up Jsoup to send that data.
What I would suggest is that you use Charles Proxy to trace the requests you make in a regular browser to this site, then make sure you're setting up Jsoup to send the right data. By watching the HTTP traffic over the wire, you'll get a better picture of what's happening, and hopefully spot what's missing.
If you can't see how to get Jsoup to add the right data to the request, just give an example of what you need.
Upvotes: 1