From 6583a3136391319f37394ea5ff68b3b8eba929b4 Mon Sep 17 00:00:00 2001 From: proffapt Date: Mon, 4 Sep 2023 18:10:06 +0530 Subject: [PATCH] docs(readme): Updated code and note for session_alive usage --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e4da27..4f44603 100644 --- a/README.md +++ b/README.md @@ -327,13 +327,17 @@ print("Logging into ERP for:", creds.ROLL_NUMBER) while True: if not erp.session_alive(session): - erp.login(headers, session, ERPCREDS=erpcreds, LOGGING=True) + _, ssoToken = erp.login(headers, session, ERPCREDS=erpcreds, LOGGING=True) else: print("Session is alive.") + ssoToken = session.cookies.get('ssoToken') + sessionToken = session.cookies.get('JSID#/IIT_ERP3') + + # Traverse ERP further using ssoToken time.sleep(2) ``` -> **Note** This is merely a Proof of Concept example; this exact functionality has been integrated into the login function itself from version **2.1.0** onwards. +> **Note** This is merely a Proof of Concept example; this exact functionality has been integrated into the login function itself from version **2.3.1** onwards.