mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01: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:
@@ -12,11 +12,11 @@ const sessionParser = session({
|
|||||||
cookie: {
|
cookie: {
|
||||||
path: config.Session.cookiePath,
|
path: config.Session.cookiePath,
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
maxAge: config.Session.cookieMaxAge
|
maxAge: config.Session.cookieMaxAge * 1000 // needs value in milliseconds
|
||||||
},
|
},
|
||||||
name: "trilium.sid",
|
name: "trilium.sid",
|
||||||
store: new FileStore({
|
store: new FileStore({
|
||||||
ttl: config.Session.cookieMaxAge / 1000, // needs value in seconds
|
ttl: config.Session.cookieMaxAge,
|
||||||
path: `${dataDir.TRILIUM_DATA_DIR}/sessions`
|
path: `${dataDir.TRILIUM_DATA_DIR}/sessions`
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const config: TriliumConfig = {
|
|||||||
process.env.TRILIUM_SESSION_COOKIEPATH || iniConfig?.Session?.cookiePath || "/",
|
process.env.TRILIUM_SESSION_COOKIEPATH || iniConfig?.Session?.cookiePath || "/",
|
||||||
|
|
||||||
cookieMaxAge:
|
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: {
|
Sync: {
|
||||||
|
|||||||
Reference in New Issue
Block a user