Skip to content

fix(auth): find Reddit cookies across all Chrome profiles, not just Default#16

Open
isaintnik wants to merge 1 commit into
public-clis:mainfrom
isaintnik:fix/chrome-multiprofile-cookies
Open

fix(auth): find Reddit cookies across all Chrome profiles, not just Default#16
isaintnik wants to merge 1 commit into
public-clis:mainfrom
isaintnik:fix/chrome-multiprofile-cookies

Conversation

@isaintnik

Copy link
Copy Markdown

Problem

rdt login fails with "No Reddit cookies found" for users whose Chrome has more than one profile and who are logged into Reddit in a non-default one.

browser_cookie3.chrome(domain_name=".reddit.com") reads only the Default profile's cookie database. When the Reddit session lives in Profile 1 / Profile 2 / etc., extraction returns nothing and login fails even though a valid session exists — rdt status then reports authenticated: false, cookie_count: 0.

Fix

Enumerate every Chrome/Chromium profile cookie DB (Default and Profile *, across the standard macOS / Linux / Windows locations) and pass each to browser_cookie3.chrome(cookie_file=...), picking the first profile that yields reddit_session. Firefox/Edge/Brave remain as fallbacks. Applied to both extraction paths (_extract_subprocess via uv, and _extract_direct).

  • No new dependencies.
  • Default is tried first, so single-profile / default users see no behavior change.

Testing

  • rdt logout && rdt login now authenticates from a Profile 1 Reddit session on macOS (Chrome), where it previously found nothing; rdt statusauthenticated: true with the correct username.
  • Full existing test suite passes locally: 123 passed.
  • ruff check clean.

…efault

browser_cookie3.chrome() reads only the "Default" profile's cookie DB, so
`rdt login` finds nothing when the logged-in Reddit session lives in a
non-default profile (Profile 1, Profile 2, ...). Multi-profile Chrome users
get "No Reddit cookies found" despite an active session.

Enumerate every Chrome/Chromium profile cookie DB (Default + "Profile N",
across macOS/Linux/Windows paths) and pass each to browser_cookie3 via
cookie_file=, selecting the first profile that yields reddit_session. Falls
back to Firefox/Edge/Brave as before. Applied to both the uv-subprocess and
direct extraction paths. Default is tried first, so single-profile behavior
is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant