long auth cookie
This commit is contained in:
+1
-1
@@ -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
|
||||
}()
|
||||
|
||||
|
||||
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user