You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 line
465B

  1. package main
  2. import (
  3. "biukop.com/sfm/loan"
  4. log "github.com/sirupsen/logrus"
  5. "net/http"
  6. "time"
  7. )
  8. func apiV1Logout(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
  9. res := apiV1ResponseBlank()
  10. ss.Expire = time.Now().Add(-10000) //make sure it expired
  11. ssEmpty := loan.Session{}
  12. log.Info("Logout user ", ss.User, " from session ", ss.Id)
  13. //send out
  14. apiV1AddTrackingCookie(w, r, &ssEmpty) //always the last one to set cookies
  15. res.sendJson(w)
  16. }