Open OldGraff opened 4 months ago
ESP32 Dev Module
ESP32-DevKitC-32E Chip Model:ESP32-D0WD-V3, revision:3
Plain board connected to AP
v2.0.16
PlatformIO
Windows 10
40Mhz
no
115200
Cookie jar can't work with session cookies because it doesn't have property expires and max-age and default value is zero https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.h#L163 When we get next cookie previous is erased because cookie.max_age.duration <= 0 condition is always true https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.cpp#L1581-L1584 I suggest changing comparison in condition to a non-strict cookie.max_age.duration < 0 or change default value in struct Cookie
expires
max-age
cookie.max_age.duration <= 0
cookie.max_age.duration < 0
struct Cookie
Also cookie string concatenation not working properly because space is before ; symbol and should be after semicolon https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.cpp#L1616 Should I create for cookie concatenation string bug another issue?
;
#include <Arduino.h> #include <HTTPClient.h> #include <WiFiSecureClient/WiFiSecureClient.h> const char *hostPtr = "https://examle.com"; // Server URL CookieJar cookieJar; HTTPClient https; void sendDataForm() { client.setCACert(someRootCACertificate); https.setReuse(true); https.setCookieJar(&cookieJar); https.begin(client, hostPtr); // Specify content-type header https.addHeader("Content-Type", "application/x-www-form-urlencoded"); // Send HTTP POST request https.POST(authFormData + hiddenInputName + "=1"); https.end(); }
I don't know what I should write here
No response
Hello @OldGraff,
networking was refactored for version 3.0.0.
Will you be able to retest your sketch with 3.1.0-RC1?
Thanks a lot!
Board
ESP32 Dev Module
Device Description
ESP32-DevKitC-32E Chip Model:ESP32-D0WD-V3, revision:3
Hardware Configuration
Plain board connected to AP
Version
v2.0.16
IDE Name
PlatformIO
Operating System
Windows 10
Flash frequency
40Mhz
PSRAM enabled
no
Upload speed
115200
Description
Cookie jar can't work with session cookies because it doesn't have property
expires
andmax-age
and default value is zero https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.h#L163 When we get next cookie previous is erased becausecookie.max_age.duration <= 0
condition is always true https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.cpp#L1581-L1584 I suggest changing comparison in condition to a non-strictcookie.max_age.duration < 0
or change default value instruct Cookie
Also cookie string concatenation not working properly because space is before
;
symbol and should be after semicolon https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/libraries/HTTPClient/src/HTTPClient.cpp#L1616 Should I create for cookie concatenation string bug another issue?Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide