From 924601ce993437390d4c57663ec21f9b6c6e119f Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:31:29 -0500 Subject: [PATCH] fix(codeforces): persist cookies after submit regardless of name (#312) ## Problem The submit path in `codeforces.py` guarded `cookie_cache.write_text` on the presence of a `JSESSIONID` cookie. Codeforces does not use `JSESSIONID`, so the cookie file was never written after submit, breaking the fast-path on subsequent submits. ## Solution Replace the name-specific guard with a non-empty check (`if browser_cookies:`), matching the unconditional save already used in the login path. Closes #301. --- scrapers/codeforces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapers/codeforces.py b/scrapers/codeforces.py index a0a0fe2..7a96483 100644 --- a/scrapers/codeforces.py +++ b/scrapers/codeforces.py @@ -550,7 +550,7 @@ def _submit_headless( try: browser_cookies = session.context.cookies() - if any(c["name"] == "JSESSIONID" for c in browser_cookies): + if browser_cookies: cookie_cache.write_text(json.dumps(browser_cookies)) except Exception: pass