]> code.octet-stream.net Git - broadcaster/blobdiff - server/main.go
Clear up logged out and old sessions
[broadcaster] / server / main.go
index 105e8581c077474241d2a8e7cbdd65bac7e6dc86..69d1ca70ddba349a6611255a5d1e4f0ae1e9e868 100644 (file)
@@ -678,6 +678,10 @@ func uploadFile(w http.ResponseWriter, r *http.Request) {
 }
 
 func logOutPage(w http.ResponseWriter, r *http.Request, user User) {
 }
 
 func logOutPage(w http.ResponseWriter, r *http.Request, user User) {
+       cookie, err := r.Cookie("broadcast_session")
+       if err == nil {
+               db.ClearSession(user.Username, cookie.Value)
+       }
        clearSessionCookie(w)
        renderHeader(w, "", user)
        tmpl := template.Must(template.ParseFS(content, "templates/logout.html"))
        clearSessionCookie(w)
        renderHeader(w, "", user)
        tmpl := template.Must(template.ParseFS(content, "templates/logout.html"))