diff --git a/models/session.go b/models/session.go index fe363ee48731..b2e4837bedd1 100644 --- a/models/session.go +++ b/models/session.go @@ -117,6 +117,6 @@ func CountSessions() (int64, error) { // CleanupSessions cleans up expired sessions func CleanupSessions(maxLifetime int64) error { - _, err := x.Where("created_unix <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{}) + _, err := x.Where("expiry <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{}) return err }