summaryrefslogtreecommitdiff
path: root/pages/logout.go
blob: dad0e1a19d75509a65e3b8453d63b08efa58b365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package pages

import (
	"gosten/session"
	"net/http"
)

func Logout() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		s := session.From(r)
		s.Invalidate()
		s.Save(w, r)
		http.Redirect(w, r, "/", http.StatusFound)
	}
}