Added X-Session-ID cookie

This commit is contained in:
Magnus Åhall 2024-05-08 17:51:41 +02:00
parent 9ce19b94b4
commit a62d2287ae

View File

@ -75,6 +75,13 @@ func (service *Service) sessionNew(w http.ResponseWriter, r *http.Request, foo *
}, },
) )
cookie := http.Cookie{}
cookie.Name = "X-Session-ID"
cookie.Value = sess.UUID
cookie.MaxAge = 86400 * 365
cookie.Path = "/"
http.SetCookie(w, &cookie)
w.Write(respJSON) w.Write(respJSON)
} // }}} } // }}}
func (service *Service) sessionAuthenticate(w http.ResponseWriter, r *http.Request, sess *session.T) { // {{{ func (service *Service) sessionAuthenticate(w http.ResponseWriter, r *http.Request, sess *session.T) { // {{{