Session get session state in current context
()
| 317 | |
| 318 | // Session get session state in current context |
| 319 | func (ctx *HttpContext) Session() (state *session.SessionState) { |
| 320 | if ctx.httpServer == nil { |
| 321 | panic("no effective http-server") |
| 322 | } |
| 323 | if !ctx.httpServer.SessionConfig().EnabledSession { |
| 324 | panic("http-server not enabled session") |
| 325 | } |
| 326 | state, _ = ctx.httpServer.sessionManager.GetSessionState(ctx.sessionID) |
| 327 | return state |
| 328 | } |
| 329 | |
| 330 | // DestorySession delete all contents of the session and set the sessionId to empty |
| 331 | func (ctx *HttpContext) DestorySession() error { |
no test coverage detected