|
- package main
-
- import (
- "biukop.com/sfm/loan"
- log "github.com/sirupsen/logrus"
- "net/http"
- "time"
- )
-
- func apiV1Logout(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
- res := apiV1ResponseBlank()
-
- ss.Expire = time.Now().Add(-10000) //make sure it expired
-
- ssEmpty := loan.Session{}
- log.Info("Logout user ", ss.User, " from session ", ss.Id)
- //send out
- apiV1AddTrackingCookie(w, r, &ssEmpty) //always the last one to set cookies
- res.sendJson(w)
- }
|