oauth2-proxy: Custom cookie name breaks redis for session

Expected Behavior

Login succeed

Current Behavior

If you specify a custom cookie name while using redis to manage sessions we are unable to decrypt the cookie:

oauth2-proxy      | [2021/01/07 15:44:47] [stored_session.go:75] Error loading cookied session: failed to decode ticket, removing session
oauth2-proxy      | [2021/01/07 15:44:47] [stored_session.go:78] Error removing session: error decoding ticket to clear session: failed to decode ticket
oauth2-proxy      | [2021/01/07 15:44:47] [oauthproxy.go:506] Error clearing session cookie: error decoding ticket to clear session: failed to decode ticket
oauth2-proxy      | 172.18.0.10 - - [2021/01/07 15:44:47] sonarr.koma.link GET - "/oauth2/sign_in" HTTP/1.1 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.107 Safari/537.36" 500 394 0.000
oauth2-proxy      | [2021/01/07 15:44:47] [stored_session.go:75] Error loading cookied session: http: named cookie not present, removing session

Possible Solution

  • Ignore the cookie name parameter when session is managed by redis
  • Decrypt using the correct cookie name

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 44 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah we still need to get round to finding a fix for this 🙂

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

I was also having the same problem. -> failed to decode ticket, removing session After searching for an answer for a long time, I finally read that article and solved the problem. Great help. thank you