Set auth cookie expiration
This commit is contained in:
parent
82e2343d5b
commit
3bcea0ec98
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"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,
|
||||
Value: tokenString,
|
||||
Path: "/",
|
||||
Expires: time.Now().AddDate(0, 1, 0),
|
||||
HttpOnly: true,
|
||||
Secure: r.TLS != nil,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue