File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1593,8 +1593,9 @@ void HTTPClient::setCookie(String date, String headerValue) {
1593
1593
1594
1594
// overwrite or delete cookie in/from cookie jar
1595
1595
time_t now_local = time (NULL );
1596
- time_t now_gmt = mktime (gmtime (&now_local));
1597
-
1596
+ struct tm tm_gmt;
1597
+ gmtime_r (&now_local, &tm_gmt);
1598
+ time_t now_gmt = mktime (&tm_gmt);
1598
1599
bool found = false ;
1599
1600
1600
1601
for (auto c = _cookieJar->begin (); c != _cookieJar->end (); ++c) {
@@ -1619,8 +1620,9 @@ void HTTPClient::setCookie(String date, String headerValue) {
1619
1620
1620
1621
bool HTTPClient::generateCookieString (String *cookieString) {
1621
1622
time_t now_local = time (NULL );
1622
- time_t now_gmt = mktime (gmtime (&now_local));
1623
-
1623
+ struct tm tm_gmt;
1624
+ gmtime_r (&now_local, &tm_gmt);
1625
+ time_t now_gmt = mktime (&tm_gmt);
1624
1626
*cookieString = " " ;
1625
1627
bool found = false ;
1626
1628
You can’t perform that action at this time.
0 commit comments