New initializes session middleware with optional configuration. Parameters: - config: Variadic parameter to override default config. Returns: - fiber.Handler: The Fiber handler for the session middleware. Usage: app.Use(session.New()) Usage: app.Use(session.New())
(config ...Config)
| 59 | // |
| 60 | // app.Use(session.New()) |
| 61 | func New(config ...Config) fiber.Handler { |
| 62 | if len(config) > 0 { |
| 63 | handler, _ := NewWithStore(config[0]) |
| 64 | return handler |
| 65 | } |
| 66 | handler, _ := NewWithStore() |
| 67 | return handler |
| 68 | } |
| 69 | |
| 70 | // NewWithStore creates session middleware with an optional custom store. |
| 71 | // |