mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23251] [CLOSED] fix: remove undefined cookie_expires from oauth_session_id set_cookie #50150
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23251
Author: @pennycoders
Created: 3/31/2026
Status: ❌ Closed
Base:
dev← Head:fix/oauth-session-cookie-expires📝 Commits (1)
a3c07eefix: remove undefined cookie_expires from oauth_session_id set_cookie📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/oauth.py(+1 -1)📄 Description
Pull Request Checklist
devbranch.oauth_session_idcookie missing, logs showNameError: name 'cookie_expires' is not defined. After fix: cookie is set correctly andsystem_oauthauth_type forwards the access token.set_cookiecalls in the same function.fix:Description
Fixes #23250
The
oauth_session_idcookie is never set after OIDC login becausecookie_expiresis referenced but never defined inhandle_callback(). This breaks thesystem_oauthauth_type for OpenAI API connections.Root cause: Line 1686 of
backend/open_webui/utils/oauth.pypasses'expires': cookie_expirestoset_cookie(), butcookie_expiresis never assigned. The variablecookie_max_ageIS defined (line 1627), and the other twoset_cookiecalls in the same function (lines 1637, 1648) correctly use onlymax_age.Fix: Remove
'expires': cookie_expiresfrom the kwargs dict, matching the pattern of the otherset_cookiecalls. Browsers prefermax_ageoverexpiresper RFC 6265 §5.3, somax_agealone is sufficient.Before:
After:
Changelog Entry
Fixed
oauth_session_idcookie not being set after OIDC login due to undefinedcookie_expiresvariable, which brokesystem_oauthauth_type for OpenAI API connectionsBreaking Changes
Additional Information
main(v0.8.12) anddevbranchesScreenshots or Videos
Before fix — error on every OIDC login:
After fix — session stored successfully:
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.