log sessions.Save()

This commit is contained in:
sentriz
2019-06-27 13:32:58 +01:00
parent 65bdda4cc2
commit ea9ddc71f6
4 changed files with 28 additions and 15 deletions

View File

@@ -1,5 +1,12 @@
package handler
import (
"log"
"net/http"
"github.com/gorilla/sessions"
)
func firstExisting(or string, strings ...string) string {
for _, s := range strings {
if s != "" {
@@ -8,3 +15,9 @@ func firstExisting(or string, strings ...string) string {
}
return or
}
func sessionLogSave(w http.ResponseWriter, r *http.Request, s *sessions.Session) {
if err := s.Save(r, w); err != nil {
log.Printf("error saving session: %v\n", err)
}
}