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