|
- 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()
- WsNotifyLogout(ss)
- ss.Expire = time.Now().Add(-10000) //make sure it expired
- log.Info("Logout user ", ss.User, " from session ", ss.Id)
- //send out
- apiV1AddTrackingCookie(w, r, ss) //always the last one to set cookies
- _, _ = res.sendJson(w)
- }
|