Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix(admin): resolve login redirect loop in admin interface (#7272) (#7280)

LeeXNc5f15aaa25ba
diff --git a/weed/command/admin.go b/weed/command/admin.go
index c1b55f105c..8321aad804 100644
--- a/weed/command/admin.go
+++ b/weed/command/admin.go
@@ -198,6 +198,13 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
return fmt.Errorf("failed to generate session key: %w", err)
}
store := cookie.NewStore(sessionKeyBytes)
+
+ // Configure session options to ensure cookies are properly saved
+ store.Options(sessions.Options{
+ Path: "/",
+ MaxAge: 3600 * 24, // 24 hours
+ })
+
r.Use(sessions.Sessions("admin-session", store))
// Static files - serve from embedded filesystem