This post demonstrates how to obtain the value of a cookie that Google uses for authentication into its user services.
Specifically, the cookie named “__Secure-1PSID” is used to check if a user has logged into their Google account before allowing access to various Google services. In another post, we created a temporary cookie using Selenium to allow an automated Python script to access Google services without having to automate the difficult process of logging in.
Using Google Chrome Browser
- Navigate to https://bard.google.com/
- Using your Google Login, click the sign in button in the upper right corner
- Sign into the Google account that was granted access to use Bard
- Open the Developer’s panel (Press F12, or navigate using menus: Click 3 dots in upper right > More Tools > Developer Tools)
- On the bar in the Developer Tools panel, select “Application” (you may need to click the >> button to reveal more items)
- Now, in the left panel under the Application tab, expand the Cookies tree
- Select the cookie item labeled “https://bard.google.com”
You will see a table with containing information about every cookie that site uses.
Select the line for the cookie named “__Secure-1PSID”. Right click the value for this cookie and copy.
Using Mozilla Firefox Browser
- Navigate to https://bard.google.com/
- Using your Google Login, click the sign in button in the upper right corner
- Sign into the Google account that was granted access to use Bard
- Open the Developer’s panel by clicking the 3 horizontal bards in the upper-right corner of the browser. Select More Tools > Web Developer Tools
- On the bar in the Developer Tools panel, select “Storage” (you may need to click the >> button to reveal more items)
- Now, in the left panel under the Storage tab, expand the “Cookies” tree
- Select the cookie item labeled “https://bard.google.com”
You should see a table containing every cookie that site uses.
Select the line for the cookie named “__Secure-1PSID”. Right click the value for this cookie and copy.