From 519e07801523a8a86f166d63ee07e96d85135704 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 22 Oct 2016 04:09:44 -0700 Subject: debugging cookies --- system/admin/handlers.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'system') diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 253abec..e3950e5 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -331,12 +331,16 @@ func configUsersEditHandler(res http.ResponseWriter, req *http.Request) { return } - // add it to cookie +1 week expiration - http.SetCookie(res, &http.Cookie{ + // add token to cookie +1 week expiration + cookie := &http.Cookie{ Name: "_token", Value: token, Expires: week, - }) + } + http.SetCookie(res, cookie) + + // add new token cookie to the request + req.AddCookie(cookie) http.Redirect(res, req, strings.TrimSuffix(req.URL.String(), "/edit"), http.StatusFound) -- cgit v1.2.3