mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
feat(session_parser): use seconds for setting maxAge and update default value to 21 days
21 days was used in the login route previously, when "remember me" was set
This commit is contained in:
parent
04827c0ce1
commit
2a740781cb
@ -12,11 +12,11 @@ const sessionParser = session({
|
||||
cookie: {
|
||||
path: config.Session.cookiePath,
|
||||
httpOnly: true,
|
||||
maxAge: config.Session.cookieMaxAge
|
||||
maxAge: config.Session.cookieMaxAge * 1000 // needs value in milliseconds
|
||||
},
|
||||
name: "trilium.sid",
|
||||
store: new FileStore({
|
||||
ttl: config.Session.cookieMaxAge / 1000, // needs value in seconds
|
||||
ttl: config.Session.cookieMaxAge,
|
||||
path: `${dataDir.TRILIUM_DATA_DIR}/sessions`
|
||||
})
|
||||
});
|
||||
|
@ -85,7 +85,7 @@ const config: TriliumConfig = {
|
||||
process.env.TRILIUM_SESSION_COOKIEPATH || iniConfig?.Session?.cookiePath || "/",
|
||||
|
||||
cookieMaxAge:
|
||||
process.env.TRILIUM_SESSION_COOKIEMAXAGE || iniConfig?.Session?.cookieMaxAge || "24 * 60 * 60 * 1000" // 24 hours in Milliseconds
|
||||
process.env.TRILIUM_SESSION_COOKIEMAXAGE || iniConfig?.Session?.cookieMaxAge || 21 * 24 * 60 * 60 // 21 Days in Seconds
|
||||
},
|
||||
|
||||
Sync: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user