You are true : my first request (the POST one, in order to be authentificated) is wrong.
I got a cookie, but i was not logged-in.
Moreover, my header content wasn't well written :
content.append("tr");
content.append("=");
content.append("login");
content.append("login");
content.append("=");
content.append("login");
content.append("referer");
content.append("=");
content.append("");
content.append("nickname");
content.append("=");
content.append(identifiant);
content.append("&");
content.append("password");
content.append("=");
content.append(password);
content.append("&");
content.append("submit");
content.append("=");
content.append("Connexion");
QByteArray content = "";
content.append("tr");
content.append("=");
content.append("login");
content.append("login");
content.append("=");
content.append("login");
content.append("referer");
content.append("=");
content.append("");
content.append("nickname");
content.append("=");
content.append(identifiant);
content.append("&");
content.append("password");
content.append("=");
content.append(password);
content.append("&");
content.append("submit");
content.append("=");
content.append("Connexion");
To copy to clipboard, switch view to plain text mode
Some "&" were missing !
So here is my new content :
content.append("tr");
content.append("=");
content.append("login");
content.append("&");
content.append("login");
content.append("=");
content.append("login");
content.append("&");
content.append("referer");
content.append("=");
content.append("http%3A%2F%2Fcourriel%2Findex.php");
content.append("&");
content.append("nickname");
content.append("=");
content.append("Stagiaire");
content.append("&");
content.append("password");
content.append("=");
content.append("%2FQDMSy9P");
content.append("&");
content.append("lifetime");
content.append("=");
content.append("10000");
content.append("&");
content.append("submit");
content.append("=");
content.append("Connexion");
QByteArray content = "";
content.append("tr");
content.append("=");
content.append("login");
content.append("&");
content.append("login");
content.append("=");
content.append("login");
content.append("&");
content.append("referer");
content.append("=");
content.append("http%3A%2F%2Fcourriel%2Findex.php");
content.append("&");
content.append("nickname");
content.append("=");
content.append("Stagiaire");
content.append("&");
content.append("password");
content.append("=");
content.append("%2FQDMSy9P");
content.append("&");
content.append("lifetime");
content.append("=");
content.append("10000");
content.append("&");
content.append("submit");
content.append("=");
content.append("Connexion");
To copy to clipboard, switch view to plain text mode
In order to prevent url encoding errors, wrote the "/" directly with "%2F".
Now, my responseHeaderReceived() signal catch an error :
statusCode = 302
reasonPhrase = Found
That's strange, cause the 302 error indicates that the Web server thinks that my URL has been temporarily redirected to another URL.
Here is the full responseHeader :
HTTP/1.1 302 Found
date: Thu, 05 Apr 2007 12:55:23 GMT
server: Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.6-1~bpo.1 mod_ssl/2.0.54 OpenSSL/0.9.7e
x-powered-by: PHP/5.1.6-1~bpo.1
set-cookie: OV1274289294=b5ca1f5abaeea5cb6944080a88adc958; path=/
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
pragma: no-cache
set-cookie: c_nickname=Stagiaire; expires=Thu, 05-Apr-2007 15:42:03 GMT
set-cookie: c_password=a07390205157ca30543f2128de117385; expires=Thu, 05-Apr-2007 15:42:03 GMT
location: http://courriel/index.php
transfer-encoding: chunked
content-type: text/html
HTTP/1.1 302 Found
date: Thu, 05 Apr 2007 12:55:23 GMT
server: Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.6-1~bpo.1 mod_ssl/2.0.54 OpenSSL/0.9.7e
x-powered-by: PHP/5.1.6-1~bpo.1
set-cookie: OV1274289294=b5ca1f5abaeea5cb6944080a88adc958; path=/
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
pragma: no-cache
set-cookie: c_nickname=Stagiaire; expires=Thu, 05-Apr-2007 15:42:03 GMT
set-cookie: c_password=a07390205157ca30543f2128de117385; expires=Thu, 05-Apr-2007 15:42:03 GMT
location: http://courriel/index.php
transfer-encoding: chunked
content-type: text/html
To copy to clipboard, switch view to plain text mode
Now, I'm logged in and everything is OK... If I don't care about the 302 error.
So, I've you got an idea to explain why I get such error, please ?
Bookmarks