Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode-Bard DOES NOT WORK... Cookie errors for plugins and API wrapper... still reporting cookie problems #11

Open
richlysakowski opened this issue Oct 9, 2023 · 10 comments

Comments

@richlysakowski
Copy link

I added the cookie as instructed.

Here's my prompt.

You
What is the os module in the Python Standard Library?

Bard ERROR MESSAGE:
"Failed to get bard params SNlM0e, pls retry or check your cookies. You can get your cookie by following the instructions provided in this link."
Google is blocking this VSCode extension, the same way it blocks Bard-API and other wrappers around the Bard Chat interface in a browser.

It looks like Google is forcing everyone to use their PALM API package.

dsdanielpark/Bard-API#155

Too bad. Great idea. Not working though.

Big Tech, Cloud Monopoly Sledge Hammer comes down on developers again!!!

@richlysakowski richlysakowski changed the title VSCode-Bard plugin errors ... still reporting cookie problems VSCode-Bard DOES NOT WORK... Cookie errors for plugins and API wrapper... still reporting cookie problems Oct 9, 2023
@JimmyDaddy
Copy link
Owner

I have tried this after reseting cookie, it works:
截屏2023-10-16 14 37 10

you can reset your cookie and try again

@ZdenekMerka
Copy link

What does mean 'reset cookie', How can I do it. Should I reset cookie in browser or in VS code. Can you provide instructions. Thank very much.

@ZdenekMerka
Copy link

Today I try to solution 2 and it works.

@HandisableL
Copy link

I try Solution 1&2,Both failed in Firefox,But solution 2 OK in new edge.

@stefanbosak
Copy link

stefanbosak commented Dec 13, 2023

Hi to all,

for accessing to Google Bard service more cookies are required in general. If following cookies are used it is not needed to have opened session to bard.google.com in any of web browser, but keep in mind that related __Secure cookies might be regenerated after re-login to Google services). No changes on the side of VSCode plugin are needed, plugin has sufficient support in codebase to proceed all related cookies, just need to be provided as string consist of separated cookies like following pattern: __Secure-<cookie_1_key>=<cookie_1_value>;__Secure-<cookie_2_key>=<cookie_2_value>;

Recommendation for extracting of cookies - Firefox users (feel free to align to your case/preference):
prerequisites: Linux OS, sqlite3, xclip, Firefox installed

Firefox ESR:
sqlite3 ~/.mozilla/firefox/*.default-esr/cookies.sqlite """SELECT name, value FROM moz_cookies WHERE host LIKE '%.google.com' AND name LIKE '__Secure-1PSID%'""" | sed 's/$/;/g;s/|//g' | xclip -selection clipboard

Firefox Release:
sqlite3 ~/.mozilla/firefox/*.default-release/cookies.sqlite """SELECT name, value FROM moz_cookies WHERE host LIKE '%.google.com' AND name LIKE '__Secure-1PSID%'""" | sed 's/$/;/g;s/|//g' | xclip -selection clipboard

Note for Firefox data gathering:
Based on many reasons extracting of SQLlite data from Firefox is possible only when given instance of Firefox is not running,
it means when Firefox is running there is lock on SQLlite database of given Firefox instance. Above mentioned SQLlite aproach for Firefox is reliable way for automating data gathering (just still need to take care carefully about data lifecycle changes dependend on service of given provider which is quite common, e. g. cookies might be regenerated after relogin to service, etc...). For Firefox advanced users using Firefox containers (or Firefox profiles) and eventually special configuration - they do not need to worry about some cases too much/very frequently.

Note for other browsers
There are more possibilities how to extract __Secure cookie data via other browsers, but might need more advanced approaches to handle data gathering really reliable way from mid/long term perspective.

When needed just update plugin settings - provide up-to-data cookie data.

Suggestion for plugin owner/developer:
Would be really valuable if given cookie parameter could be stored in dedicated file to be able to automate updating of cookie data parameters.

Thank you.

Stefan

@ImYourBoyRoy
Copy link

I was having a similar issue and found the solution to be rather simple I think.

I was using method 1 to no avail. method 2 didn't work either....probably doing that one wrong. anyway, what worked for me was

using Chrome in windows 11: we go to the cookie in Application.
1 - from the bard.google.com/chat interface i went to Developer Tools
ctrl+shift+i
2 - go to Application (just like before)
3 - go to Storage > Cookies and right click on the bard.google.com cookie and select "clear". this will wipe out the cookies for you here. Then Refrersh the page. ctrl+r
image

4 - now, you have a new set of cookies. copy the new cookie info...
__Secure-1PSID=xxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

I don't know if the "." at the end of the cookie is necessary but it worked for me just fine. it was part of the cookie in the page.

I hope this helps anyone else.

I'm sure there is a pythonic way of doing this but I didn't care enough to try to do this. i'm sure bard or gpt4 can write that out though. ;)

@lacostenycoder
Copy link

lacostenycoder commented Jan 19, 2024

The solution for me was to use ONLY THE COOKIE VALUE. So don't try to add the prefix.

This DOES NOT WORK, try to paste => __Secure-1PSID=12345abcde67890fghij12345abcde67890fghij

THIS WORKS!!!! paste only the cookie value => 12345abcde67890fghij12345abcde67890fghij

Maybe update the instructions to be specific about this.

UPDATE: Well this had been working but today it's not. I tried copying cookies from two different browsers, both failed to work. 🤦🏻‍♂️

@stefanbosak
Copy link

stefanbosak commented Jan 20, 2024

Hi to all,

cookies are working as expected, implementation of this plugin regarding handling of cookies is really sufficient
even from mid/long term perspective (more than reasonable good level of development experience of plugin author).
Problem is laying in more clear understanding of cookie usage, mostly because it is not doccumented anywhere so far
and might be eventually very confusing for many users (especially groups just following copy & past approaches).

Quick summary for better understanding about required data set to be provided for this plugin
(all of the following cookies are really required, it means extract all of them via preferred approach,
recommended structure for passing to plugin):
__Secure-1PSID=<data_part_01>;__Secure-1PSIDTS=<data_part_02>;__Secure-1PSIDCC=<data_part_03>;

Note for <data_part_{01,02,03}>:

  • pass whole content as is for given cookie, not just partial set
    (even there is "." at the end or any other character which might seems to be strange)

Above described is highly recommended to be able to use of Google Bard service in general.

What is also important to keep in mind:

  • cookies might be re-generaded when you are relogin to Google services in different environment
    • it is really well implemented from Google side, they have considered a lot within implementation especially
      from security perspective
    • when cookies are re-generated (from any reason) user has to re-visit, re-export them again in environmnent where Google Bard services will be used, e.g. this plugin (reason is that some data in cookies are deeply thight to given environment based on above mentioned [corresponiding Google design/implementation approach which seems to be really reasonable])
  • for Firefox users let me recommend following: related secure cookies comment in this thread
  • just quick notes:
    • I am using Google Bard service with several other tools and above mentioned is based on outcomes i have recognized during interaction/working with such as tools
    • I have also shared possible automated approach how to extract cookie datasets (see note mentioned above, there is link to comment in this thread)

Summary
This plugin is implemented reasonable well/suffiently and problems with cookies are more-less consequences of misunderstanding/inpropper usage (frequently hard to understand related stuff deeply, but just try to read this comment more carefully and issues could be gone)

Thank you for understanding and cooperation in advance,
especially many thanks to author of this plugin for his efforts spent on.

Have a nice day.

@xuanhop
Copy link

xuanhop commented Jan 29, 2024

Solution 2 work fine. :) you need to copy and paste all cookies. The first solution is just only one.

@daveywoods
Copy link

The solution posted by V1x0r worked for me. Thanks!

@JimmyDaddy JimmyDaddy pinned this issue Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants