func TestStore_Get(t *testing.T) {
	unexpectedID := "test-session-id"
	app := fiber.New()
	t.Run("session should persisted even session is invalid", func(t *testing.T) {
		store := New()
		ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(ctx)
		ctx.Request().Header.SetCookie(store.sessionName, unexpectedID)
		acquiredSession, err := store.Get(ctx)
		utils.AssertEqual(t, err, nil)
		if acquiredSession.ID() != unexpectedID {
			t.Fatal("server should not accept the unexpectedID which is not in the store")
		}
	})
}
go test -run TestStore_Get
Regression: https://github.com/gofiber/fiber/issues/1408
package session
import (
	"fmt"
	"testing"
	"github.com/gofiber/fiber/v2"
	"github.com/gofiber/fiber/v2/utils"
	"github.com/valyala/fasthttp"
)
func TestStore_getSessionID(t *testing.T) {
	expectedID := "test-session-id"
	app := fiber.New()
	t.Run("from cookie", func(t *testing.T) {
		store := New()
		ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(ctx)
		ctx.Request().Header.SetCookie(store.sessionName, expectedID)
		utils.AssertEqual(t, expectedID, store.getSessionID(ctx))
	})
	t.Run("from header", func(t *testing.T) {
		store := New(Config{
			KeyLookup: "header:session_id",
		})
		ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(ctx)
		ctx.Request().Header.Set(store.sessionName, expectedID)
		utils.AssertEqual(t, expectedID, store.getSessionID(ctx))
	})
	t.Run("from url query", func(t *testing.T) {
		store := New(Config{
			KeyLookup: "query:session_id",
		})
		ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
		defer app.ReleaseCtx(ctx)
		ctx.Request().SetRequestURI(fmt.Sprintf("/path?%s=%s", store.sessionName, expectedID))
		utils.AssertEqual(t, expectedID, store.getSessionID(ctx))
	})
}