adam-hanna / jwt-auth

This package provides json web token (jwt) middleware for goLang http servers
MIT License
231 stars 43 forks source link

Max-Age in setCredentialsOnResponseWriter function #19

Open decozo150 opened 2 years ago

decozo150 commented 2 years ago

// tokens are in cookies // note: don't use an "Expires" in auth cookies bc browsers won't send expired cookies? authCookie := http.Cookie{ Name: a.options.AuthTokenName, Value: authTokenString, Path: "/", // Expires: time.Now().Add(a.options.AuthTokenValidTime), HttpOnly: true, Secure: !a.options.IsDevEnv, } http.SetCookie(w, &authCookie)

You've commented "Expires" and you're not setting "MaxAge" either: MaxAge: int(a.options.AuthTokenValidTime.Seconds()),

adam-hanna commented 2 years ago

hhhmmm... shwoops.

Thanks