func NewWithConfig(config Config, opt ...session.Option) gin.HandlerFunc {
	if config.ErrorHandleFunc == nil {
		config.ErrorHandleFunc = DefaultConfig.ErrorHandleFunc
	}
	manageKey = config.ManageKey
	if manageKey == "" {
		manageKey = DefaultConfig.ManageKey
	}
	storeKey = config.StoreKey
	if storeKey == "" {
		storeKey = DefaultConfig.StoreKey
	}
	manage := session.NewManager(opt...)
	return func(ctx *gin.Context) {
		if config.Skipper != nil && config.Skipper(ctx) {
			ctx.Next()
			return
		}
		ctx.Set(manageKey, manage)
		store, err := manage.Start(context.Background(), ctx.Writer, ctx.Request)
		if err != nil {
			config.ErrorHandleFunc(ctx, err)
			return
		}
		ctx.Set(storeKey, store)
		ctx.Next()
	}
}
NewWithConfig create a session middleware
package ginsession
import (
	"context"
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/go-session/session"
)
type (
	ErrorHandleFunc func(*gin.Context, error)
	Config struct {
		ErrorHandleFunc ErrorHandleFunc
		StoreKey string
		ManageKey string
		Skipper func(*gin.Context) bool
	}
)
var (
	storeKey  string
	manageKey string
	DefaultConfig = Config{
		ErrorHandleFunc: func(ctx *gin.Context, err error) {
			ctx.AbortWithError(500, err)
		},
		StoreKey:  "github.com/go-session/gin-session/store",
		ManageKey: "github.com/go-session/gin-session/manage",
		Skipper: func(_ *gin.Context) bool {
			return false
		},
	}
)
func New(opt ...session.Option) gin.HandlerFunc {
	return NewWithConfig(DefaultConfig, opt...)
}