Skip to content

Commit 4a6e7ce

Browse files
committed
Add comment explaining the API Session Retry change
1 parent 65c79ad commit 4a6e7ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ function sendRequest($request, $apiSessionRetry = false)
173173

174174
$result = json_decode($result, true);
175175

176+
// Due to a bug in the netcup CCP DNS API, sometimes sessions expire too early (statuscode 4001, error message: "The session id is not in a valid format."
177+
// We work around this bug by trying to login again once.
178+
// See Github issue #21.
176179
if ($result['statuscode'] === 4001 && $apiSessionRetry === false) {
177180
outputWarning("Received API error 4001: The session id is not in a valid format. Most likely the session expired. Logging in again and retrying once.");
178181
$newApisessionid = login(CUSTOMERNR, APIKEY, APIPASSWORD);

0 commit comments

Comments
 (0)