更新时间:2022-08-25 GMT+08:00
分享

更换SessionID

应用场景

用户名和密码认证通过后,更换SessionID。

前提条件

用户名和密码验证通过。

接口概述

更换会话标识。

请求URL

/action.cgi?ActionID=WEB_ChangeSessionIDAPI

private static String changeSeesionId() {
        String uri = baseUrl + "/action.cgi?ActionID=WEB_ChangeSessionIDAPI";
        Map<String, String> header = new HashMap<>();
        HttpClientUtil.post(uri, null, header);
        return HttpClientUtil.sessionId;
    }

请求成功返回报文

该操作获取了一个新的SessionID,后续API操作使用更新后的SessionID。

HTTP/1.1 200 OK
Set-Cookie: SessionID=920ac57c3a96c61a3350dd077b772d6483b75ba7a6a16b9c1531bbe7bd878580; Path=/; Secure; HttpOnly
Connection: Keep-Alive
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: sameorigin
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubdomains
Content-Security-Policy: script-src 'self' 'unsafe-eval' 'unsafe-inline' ;img-src 'self'
Content-Type: text/plain
Response-Result: 1
Content-Length: 83

{"success":1,"data":"{\"acSessionId\":\"\",\"szTermType\":\"Terminal Type\"}"}

相关文档