Skip to content

fix: improve cookie expiry check by parsing JWT payload#180

Merged
QuBenhao merged 1 commit intomasterfrom
fix/cookie-expiry-check
Mar 14, 2026
Merged

fix: improve cookie expiry check by parsing JWT payload#180
QuBenhao merged 1 commit intomasterfrom
fix/cookie-expiry-check

Conversation

@QuBenhao
Copy link
Owner

Summary

  • Fix cookie expiry check by parsing the LEETCODE_SESSION JWT payload instead of checking unrelated third-party timestamps
  • The previous implementation incorrectly checked timestamps from Cloudflare, Baidu Analytics, and Google Analytics cookies
  • Now properly extracts and checks the expired_time_ field from the JWT payload

Test plan

  • Verified cookie expiry detection works correctly with valid JWT tokens
  • Tested with both valid and expired cookies

🤖 Generated with Claude Code

The previous implementation checked timestamps from third-party cookies
(Cloudflare, Baidu Analytics, Google Analytics) which don't represent
the actual LeetCode login state.

Now properly parses the LEETCODE_SESSION JWT to check the expired_time_
field for accurate expiry detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@QuBenhao QuBenhao merged commit e0dcda1 into master Mar 14, 2026
@QuBenhao QuBenhao deleted the fix/cookie-expiry-check branch March 14, 2026 14:38
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