fix(codeforces): persist cookies after submit regardless of name

Problem: the submit path guarded `cookie_cache.write_text` on the
presence of a `JSESSIONID` cookie, which Codeforces does not use.
The file was therefore never written, breaking the fast-path on
subsequent submits.

Solution: replace the name-specific guard with a non-empty check so
cookies are persisted whenever the browser session has any cookies,
matching the unconditional save already used in the login path.
This commit is contained in:
Barrett Ruth 2026-03-05 15:27:25 -05:00
parent 90337fab91
commit f9c7b83b0e

View file

@ -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