Closed jvincilione closed 3 months ago
Of course, the moment I post this after fighting it for 5 hours I get it to work.
Hey @jvincilione , I'm having the exact same error. What helped you in getting it to work.
I also have the same error @jvincilione, can you explain how to get it to work?
Got it working. The problem with me was that the gorilla/sessions
main branch was broken for golang versions <= 1.22. I downgraded to the last release of the package. Then the error was resolved.
I also have the same error @jvincilione, can you explain how to get it to work?
@matwate My issue was that I had store.Options.SameSite = http.SameSiteStrictMode
.
My setup is substantially different from when I wrote this, but currently, I have store.Options.SameSite = http.SameSiteLaxMode
instead and don't have any issues.
thx @jvincilione ! you saved my day...
I can confirm that store.Options.SameSite = http.SameSiteLaxMode
works!
with store.Options.SameSite = http.SameSiteLaxMode
I still face the Error #01: could not find a matching session for this request
. Anyone still having this error?
@cocoza4 - there are several things that can cause this issue, what have you tried?
I wasted 2 days on this... was failing in chrome while firefox was fine. SameSiteLaxMode works in both now
I'm running an app using Gin and wanted to add Google and possibly a couple other OAuth providers. I ran into an issue where I'm consistently getting the error "could not find a matching session for this request".
After debugging I noticed that "_gothic_session" is always empty. Assuming I was doing something wrong, I found a few implementations and tutorials online, but none of them used
gorilla/sessions
except for one. After pulling the repo for one not using sessions I got a secure key error. I tried the one using sessions and received the "could not find a matching session for this request" error after going through the google login screensI decided to pull the example application in this repo - stripped it down to just use google (and run on :8080), and got the same result. So, I added
gorilla/sessions
and tried again. While I'm able to go through the google auth flow (selecting my user, etc), it errors "could not find a matching session for this request".Here is the full code I tried to run - with the google Client ID/Secret redacted:
For reference, I tried both
localhost
and127.0.0.1
along with adding my domain to my hosts file and trying it that way. All resulted in the same. Additionally, I also tried adding a domain to the session options.Go Version: go version go1.22.4 darwin/amd64 MacOS Sonoma 14.5