EdgeGPT icon indicating copy to clipboard operation
EdgeGPT copied to clipboard

Can i store cookie with environment variable instead of cookie.json?

Open xcloudx12345 opened this issue 2 years ago • 2 comments

i try to run it on replit and store the cookie in json, It doesn't seem safe Is there any other way to login?

xcloudx12345 avatar Feb 16 '23 14:02 xcloudx12345

It doesn't seem safe

What doesn't seem safe?

Can i store cookie with environment variable instead of cookie.json

Make a pull request if you wish as an option

acheong08 avatar Feb 16 '23 14:02 acheong08

IMHO, placing these in that separate JSON file is exactly as safe as placing them in the env variable. They both get referenced by the code. If "the enemy" has access to your JSON then they have equal access to your .bashrc or wherever you may keep that variable.

Interestingly enough the stored cookie works even some days afterwards. See also my today's end-user "naive" comments about Edge Chat session impermanence and how they wipe it with chocolate, mediation, and Japanese cultural joyful customs against human toxic answers, to avoid Taybot chat session cache problems.

Manamama avatar Feb 22 '23 08:02 Manamama

@acheong08 We can already store cookies from environment variables with cookies argument in ChatBot class

cookies = json.loads(os.environ.get("BING_COOKIES"))

The issue I found is that version of EdgeGPT in PyPI and in GitHub are out of sync The latest version in PyPi had no support for cookies argument in ChatBot class I had to install from GitHub to solve the issue

You can close this issue

rabilrbl avatar Mar 02 '23 18:03 rabilrbl

https://github.com/acheong08/EdgeGPT/releases/tag/0.0.52

acheong08 avatar Mar 03 '23 00:03 acheong08