long auth cookie

This commit is contained in:
Umputun
2018-01-21 15:17:43 -06:00
parent 8ef77b8105
commit 266c62f079
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -88,8 +88,8 @@ func main() {
sessionStore := func() sessions.Store {
sess := sessions.NewFilesystemStore(srvOpts.SessionStore, []byte(srvOpts.StoreKey))
sess.Options.HttpOnly = true
sess.Options.MaxAge = 15 * 24 * 3600 // 15 days in seconds
sess.Options.Secure = true
sess.Options.MaxAge = int(time.Duration(time.Hour * 24 * 365).Seconds())
return sess
}()
+2 -3
View File
@@ -16,11 +16,10 @@ import (
"github.com/didip/tollbooth"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/render"
"github.com/umputun/remark/app/rest/common"
)
var org = "Umputun"
// JSON is a map alias, just for convenience
type JSON map[string]interface{}
@@ -63,7 +62,7 @@ func Limiter(recSec int, excludeIps ...string) func(http.Handler) http.Handler {
func AppInfo(app string, version string) func(http.Handler) http.Handler {
f := func(h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Org", org)
w.Header().Set("Org", "Umputun")
w.Header().Set("App-Name", app)
w.Header().Set("App-Version", version)
if mhost := os.Getenv("MHOST"); mhost != "" {