package cookies import ( "net/http" "time" ) func AccessToken(tkn string, expiration time.Time) http.Cookie { return http.Cookie{ Name: "access_token", Value: tkn, Path: "/", Expires: expiration, MaxAge: 0, // using Expiration instead Secure: true, } }