diff --git a/frontend/Web/communication.js b/frontend/Web/communication.js index 380edf4..521e9aa 100644 --- a/frontend/Web/communication.js +++ b/frontend/Web/communication.js @@ -92,4 +92,16 @@ async function GetMyPrivilege() { let ret = await RawRequest("#Who "+session_token+" InfoQuery "+outhentication_key); return parseInt(ret.split('\n')[1].split(' ')[1]); +} + +async function RefreshSession() +{ + let tmp_channel=generateRandomString(10); + let ret=await RawRequest('#OpenSession '+tmp_channel); + operation_count=0; + session_token=ret.split('\n')[1].split(' ')[0]; + outhentication_key=ret.split('\n')[1].split(' ')[1]; + localStorage.setItem("session_token", session_token); + localStorage.setItem("outhentication_key", outhentication_key); + localStorage.setItem("operation_count", operation_count); } \ No newline at end of file