func Reply(file string, w http.ResponseWriter, r *http.Request, session *sessions.Session) { buf := bufio.NewWriter(w) t, _ := template.ParseFiles(file) t.Execute(buf, session) session.Save(r, w) buf.Flush() }
func killSession(r *http.Request, w http.ResponseWriter, s *sessions.Session) error { d := make(chan bool) kills <- &sessionAction{"session:" + s.ID, 0, nil, d} f := <-d if !f { return cantKill } var opts = *sessionStore.Options opts.MaxAge = -1 s.Options = &opts // values for k, _ := range s.Values { delete(s.Values, k) } s.Save(r, w) return nil }