diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-22 04:09:44 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-22 04:09:44 -0700 |
commit | 519e07801523a8a86f166d63ee07e96d85135704 (patch) | |
tree | 03b3d9481c51c2b5a6993a092a848dccd18f8d4a | |
parent | 1d2eab63109f2fc4ee2399c47e3aae542e4e9663 (diff) |
debugging cookies
-rw-r--r-- | system/admin/handlers.go | 10 |
1 files changed, 7 insertions, 3 deletions
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) |