Exemplo n.º 1
0
func AdminAll(w http.ResponseWriter, r *http.Request) {
	role, ok := sess.Authorized(w, r)
	if !ok || role != "admin" {
		fmt.Fprintf(w, "You are not autorized as admin. Please visit the login page")
		return
	}
	c := sess.GetAll(r)
	fmt.Fprintf(w, "Session Cookies:    %v", c)
	return
}
Exemplo n.º 2
0
func SecureAll(w http.ResponseWriter, r *http.Request) {
	_, ok := sess.Authorized(w, r)
	if !ok {
		fmt.Fprintf(w, "You are not autorized. Please visit the login page")
		return
	}
	c := sess.GetAll(r)
	fmt.Fprintf(w, "Session Cookies:    %v", c)
	return
}