func clearSession(w http.ResponseWriter, r *http.Request) error {
	session, err := auth.SessionGet(r)
	if err != nil {
		return err
	}
	session.Clear(w)
	return nil
}
clearSession clears the request session cookie entirely.
If an error is encountered in processing params, the session is cleared.
package session
import (
	"net/http"
	"strconv"
	"github.com/fragmenta/auth"
	"github.com/fragmenta/mux"
	"github.com/fragmenta/server/log"
	"github.com/fragmenta/fragmenta-cms/src/users"
)
func CurrentUser(w http.ResponseWriter, r *http.Request) *users.User {
	user := &users.User{}
	session, err := auth.Session(w, r)
	if err != nil {
		log.Info(log.V{"msg": "session error", "error": err, "status": http.StatusInternalServerError})
		return user
	}
	var id int64
	val := session.Get(auth.SessionUserKey)
	if len(val) > 0 {
		id, err = strconv.ParseInt(val, 10, 64)
		if err != nil {
			log.Info(log.V{"msg": "session error decoding", "val": val, "error": err, "status": http.StatusInternalServerError})
			return user
		}
	}
	if id > 0 {
		user, err = users.Find(id)
		if err != nil {
			log.Info(log.V{"msg": "session error user not found", "user_id": id, "error": err, "status": http.StatusNotFound})
			return user
		}
	}
	return user
}