Skip to content

fix: handle session cookies with no expiry - #1009

Merged
veronika-alraheem merged 1 commit into
mainfrom
1361-session-cookie-no-expiry
Aug 28, 2026
Merged

fix: handle session cookies with no expiry#1009
veronika-alraheem merged 1 commit into
mainfrom
1361-session-cookie-no-expiry

Conversation

@veronika-alraheem

Copy link
Copy Markdown
Contributor

PR summary

When using session cookies there is no expires or max-age attribute available. This raises a TypeError when we try to compare the None to the current time.

Fixes i1361

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the
    Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • New tests
  • Build/CI related changes
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

When authenticating with a session cookie, the AuthSession cookie has no Expires or Max-Age attribute. The requests library parses cookie.expires as None in this case. This raised a TypeError as soon as ibm_cloud_sdk_core's TokenManager compared the None expire_time against the current time.

What is the new behavior?

It now falls back to a default TTL of 400 days when cookie.expires is None.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Added a regression test that simulates a session cookie with no Expires/Max-Age attribute and verifies that authentication succeeds without error.

Comment thread ibmcloudant/couchdb_session_token_manager.py Outdated
Comment thread test/unit/test_couchdb_session_auth.py
@veronika-alraheem
veronika-alraheem force-pushed the 1361-session-cookie-no-expiry branch from 996d7db to ba022ca Compare August 28, 2026 08:18
@veronika-alraheem
veronika-alraheem force-pushed the 1361-session-cookie-no-expiry branch from ba022ca to cf915cf Compare August 28, 2026 08:21
@veronika-alraheem
veronika-alraheem merged commit b6e8c75 into main Aug 28, 2026
10 checks passed
@veronika-alraheem
veronika-alraheem deleted the 1361-session-cookie-no-expiry branch August 28, 2026 08:45
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.

2 participants