1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-13 17:42:53 +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()
if !services.IsHuman(req, rw) {
// User it not a human
http.Redirect(rw, req, "/", http.StatusFound)
rw.WriteHeader(http.StatusForbidden)
return
}

View File

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