Set auth cookie expiration
This commit is contained in:
parent
82e2343d5b
commit
3bcea0ec98
@ -6,6 +6,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/khlieng/dispatch/Godeps/_workspace/src/github.com/dgrijalva/jwt-go"
|
"github.com/khlieng/dispatch/Godeps/_workspace/src/github.com/dgrijalva/jwt-go"
|
||||||
|
|
||||||
@ -75,6 +76,7 @@ func newUser(w http.ResponseWriter, r *http.Request) *Session {
|
|||||||
Name: cookieName,
|
Name: cookieName,
|
||||||
Value: tokenString,
|
Value: tokenString,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
Expires: time.Now().AddDate(0, 1, 0),
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
Secure: r.TLS != nil,
|
Secure: r.TLS != nil,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user