newSessionCtx builds a fiber.Ctx carrying the given session_id cookie. The session middleware is intentionally not run, so the session manager falls back to loading the session from the store (the else branch).
(app *fiber.App, sessionID string)
| 2891 | // session middleware is intentionally not run, so the session manager falls back |
| 2892 | // to loading the session from the store (the else branch). |
| 2893 | func newSessionCtx(app *fiber.App, sessionID string) fiber.Ctx { |
| 2894 | reqCtx := &fasthttp.RequestCtx{} |
| 2895 | if sessionID != "" { |
| 2896 | reqCtx.Request.Header.SetCookie("session_id", sessionID) |
| 2897 | } |
| 2898 | return app.AcquireCtx(reqCtx) |
| 2899 | } |
| 2900 | |
| 2901 | // Test_SessionManager_GetRaw_StoreError covers the error branch when loading the |
| 2902 | // session from the store fails. |
no test coverage detected