diff --git a/handlers/new_session.go b/handlers/new_session.go index f6926cc..c01f71d 100644 --- a/handlers/new_session.go +++ b/handlers/new_session.go @@ -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 } diff --git a/services/recaptcha.go b/services/recaptcha.go index 53548de..6a932c1 100644 --- a/services/recaptcha.go +++ b/services/recaptcha.go @@ -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