Update: I let-rally tried 12 suggested solutions but nothing worked at all.
Is my question missing any details? The suggested answer doesn't solve the problem
In python I wrote:
print(s.cookies.get_dict())
where s is my session, the output is:
{'lubl': 'https%3A%2F%2Fopenworld.com%2Fconfirm', 'rishum': 'SHjshd2398-'}
Now my question is how can I edit rishum cookie such that I want to append 'test' next to it (or to make things simple replace it by 'test')?
For example, I want:
'rishum': 'SHjshd2398-test'
Note: as someone suggested I tried the following but didn't work:
print(s.cookies.get_dict())
s.cookies.get_dict()['rishum'] = 'test'
print(s.cookies.get_dict())
output before and after is:
{'lubl': 'confirm', 'rishum': 'SUqsadkjn239s8n-', 'PHPSESSID': 'nfdskjfn3k42342', 'authchallenge': 'asjkdnjnkj34'}
{'rishum': 'SUqsadkjn239s8n-', 'lubl': 'confirm', 'PHPSESSID': 'nfdskjfn3k42342', 'authchallenge': 'asjkdnjnkj34'}
Note the order has changed.
question from:
https://stackoverflow.com/questions/65871734/python-session-update-cookies 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…