Thank you,
I think I found where the problem is :
In fact : the login page redirects to an other page, which sets the cookie.
The problem is that this redirection changes from POST to GET.
By default (and I guess it was not the case is my previous CI 3 setup), curl redirect POST to POST and then I got a timeout
I disabled redirect as I don't need the second page.
I then tried to enable redirect from POST to GET using following option :
PHP Code:
'allow_redirects' => [
'strict' => FALSE,
],
When I look at the debug file, it seems that CI4/curl noticed to change from POST to GET, but finally do a POST request instead of a GET anyway:
Code:
< HTTP/1.1 200 OK
< Connection: close
< Content-Type: text/html
< Cache-Control: no-cache
< Pragma: no-cache, no-store
<
* Closing connection
* Trying 192.168.1.12:80...
* Connected to 192.168.1.12 (192.168.1.12) port 80
> POST /fr/login.htm HTTP/1.1
Host: 192.168.1.12
Accept: */*
Content-Length: 50
Content-Type: application/x-www-form-urlencoded
< HTTP/1.1 302 Found
< Connection: close
* Please rewind output before next send
< Location: /fr/welcome.htm
<
* Closing connection
* Issue another request to this URL: 'http://192.168.1.12/fr/welcome.htm'
* Switch from POST to GET <===== HERE, WE CAN SEE IT WILL TRY TO CHANGE POST TO GET
* Hostname 192.168.1.12 was found in DNS cache
* Trying 192.168.1.12:80...
* Connected to 192.168.1.12 (192.168.1.12) port 80
> POST /fr/welcome.htm HTTP/1.1 <====== HERE, WE HAVE A POST REQUEST INSTEAD OF GET
Host: 192.168.1.12
Accept: */*
Content-Length: 50
Content-Type: application/x-www-form-urlencoded
* Operation timed out after 3233 milliseconds with 0 bytes received
* Closing connection
By the way, I'm using an Alpine 3.18 docker image with PHP 8.1.