From 3bcea0ec982e9ac6234be46c8c640e7aeceac1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Tue, 19 Jan 2016 20:31:22 +0100 Subject: [PATCH] Set auth cookie expiration --- server/auth.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/auth.go b/server/auth.go index f79b0421..fe258417 100644 --- a/server/auth.go +++ b/server/auth.go @@ -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, })