1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 01:57:32 +08:00

Increase cookie time

This commit is contained in:
Marcos Lilljedahl 2017-03-14 14:59:06 -03:00
parent a875bbe23e
commit 2c7af720c0
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
req.ParseForm() req.ParseForm()
if !services.IsHuman(req, rw) { if !services.IsHuman(req, rw) {
// User it not a human // User it not a human
http.Redirect(rw, req, "/", http.StatusFound) rw.WriteHeader(http.StatusForbidden)
return return
} }

View File

@ -83,7 +83,7 @@ func IsHuman(req *http.Request, rw http.ResponseWriter) bool {
http.SetCookie(rw, &http.Cookie{ http.SetCookie(rw, &http.Cookie{
Name: "session_id", Name: "session_id",
Value: encoded, Value: encoded,
Expires: time.Now().Add(10 * time.Second), Expires: time.Now().Add(3 * time.Hour),
}) })
return true return true