Skip to content

Commit a238fdf

Browse files
committed
next try
1 parent 35ba48b commit a238fdf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gateway/middleware.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ func (t *BaseMiddleware) UpdateRequestSession(r *http.Request) bool {
468468

469469
// Reset session state, useful for benchmarks when request object stays the same.
470470
session.Reset()
471+
// Mark session as restored for
472+
session.MarkAsRestored()
471473

472474
if !t.Spec.GlobalConfig.LocalSessionCache.DisableCacheSessionState {
473475
t.Gw.SessionCache.Set(session.KeyHash(), session.Clone(), cache.DefaultExpiration)
@@ -699,7 +701,6 @@ func (t *BaseMiddleware) CheckSessionAndIdentityForValidKey(originalKey string,
699701
key = session.KeyID
700702
session := session.Clone()
701703
session.SetKeyHash(keyHash)
702-
session.MarkAsNew() // mark remote MDCB session as new to make possible save it into the local storage (local redis)
703704
// If not in Session, and got it from AuthHandler, create a session with a new TTL
704705
t.Logger().Info("Recreating session for key: ", t.Gw.obfuscateKey(key))
705706

@@ -718,6 +719,7 @@ func (t *BaseMiddleware) CheckSessionAndIdentityForValidKey(originalKey string,
718719
t.Logger().Debug("Lifetime is: ", session.Lifetime(t.Spec.GetSessionLifetimeRespectsKeyExpiration(), t.Spec.SessionLifetime, t.Gw.GetConfig().ForceGlobalSessionLifetime, t.Gw.GetConfig().GlobalSessionLifetime))
719720

720721
session.Touch()
722+
session.MarkAsNew() // mark remote MDCB session as new to make possible save it into the local storage (local redis)
721723

722724
return session, found
723725
}

0 commit comments

Comments
 (0)