CreateSession creates a new session and returns the sessionID
()
| 44 | |
| 45 | // CreateSession creates a new session and returns the sessionID |
| 46 | func (m *SessionManager) CreateSession() (string, error) { |
| 47 | sessionID, err := MakeSessionID() |
| 48 | if err != nil { |
| 49 | return "", err |
| 50 | } |
| 51 | |
| 52 | m.sessions[sessionID] = Session{ |
| 53 | Data: make(map[string]interface{}), |
| 54 | } |
| 55 | |
| 56 | return sessionID, nil |
| 57 | } |
| 58 | |
| 59 | // ErrSessionNotFound returned when sessionID not listed in |
| 60 | // SessionManager |