How to automate login a website
can someone guide me how i can automate login to a website using this library . in order to login cookies must be handled i have tried that .
HttpRequest request = HttpRequest.get("http://website.com/"); request.trustAllCerts(); request.trustAllHosts(); request.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"); request.useCaches(true); String cookies = request.header("Set-Cookie"); String response = request.body(); StringBuilder sb = new StringBuilder(); sb.append("email=clientemail%40gmail.com&password=clientpass&login_button=Login"); HttpRequest rq = HttpRequest.post("http://website.com/").send(sb); rq.header("Cookie", cookies); String html = rq.body();
:+1: I think there isn't this feature. It's would be a good improvement
Maybe this helps https://developer.android.com/reference/android/accounts/AccountManager.html
you may store session() it will keep user login until session ends
if(!isset($_SESSION['x'])) { header("Location: index.php"); } like this