log sessions.Save()
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user