JSoup Login to website AND then open another page KEEPING that login session.
Could anyone explain how to log in on this website using JSoup?
Username:
Anything (E.G. 110000, 110001 and 110002 all work)
Password:
"sgl1617" (I don't care about someone knowing the password, you can't do anything with it.)
My code currently (Completely fails, I'm sure I'm on the wrong 'track'):
Connection.Response loginForm = Jsoup.connect("http://www.gymnasiumleiden.nl/roostersinfoweb/infoweb/index.php")
.method(Connection.Method.GET)
.execute();
Document doc = Jsoup.connect("http://www.gymnasiumleiden.nl/roostersinfoweb/infoweb/index.php").get();Jsoup.connect("http://www.gymnasiumleiden.nl/roostersinfoweb/infoweb/authentication.php")
.data("cookieexists", "false")
.data("username", "110638")
.data("password", "sgl1617")
.data("login", "Login")
.cookies(loginForm.cookies())
.post();
One thing I'm sure of: authentication.php doesn't exist.
I am new to JSoup, so please explain some code and tell me about the 'cookie' part (I know what cookies are, but not how you use them with JSoup.)