alexedwards / scs

HTTP Session Management for Go
MIT License
2.05k stars 165 forks source link

Mergesession #126

Closed jum closed 2 years ago

jum commented 2 years ago

Add a MergeSession method to ease merging of sessions lost due to strict cookies across oauth2 login flows.

With strict cookies, you will acquire a new session upon returning to your app from the oauth provider via the call back url. If you save your session string somewhere together with the state token that is given on the redirect to the oauth provider, you can use MergeSession to merge the state from the original session before the redirect into your new session.