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:
parent
a875bbe23e
commit
2c7af720c0
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user