mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 22:59:37 +02:00
Update:Replace default express-session MemoryStore with stable MemoryStore #2538
This commit is contained in:
parent
bba8920855
commit
4d3b3d1740
3 changed files with 331 additions and 1 deletions
|
@ -41,6 +41,7 @@ const LibraryScanner = require('./scanner/LibraryScanner')
|
|||
//Import the main Passport and Express-Session library
|
||||
const passport = require('passport')
|
||||
const expressSession = require('express-session')
|
||||
const MemoryStore = require('./libs/memorystore')(expressSession)
|
||||
|
||||
class Server {
|
||||
constructor(SOURCE, PORT, HOST, CONFIG_PATH, METADATA_PATH, ROUTER_BASE_PATH) {
|
||||
|
@ -216,7 +217,12 @@ class Server {
|
|||
cookie: {
|
||||
// also send the cookie if were are not on https (not every use has https)
|
||||
secure: false
|
||||
}
|
||||
},
|
||||
store: new MemoryStore({
|
||||
checkPeriod: 86400000, // prune expired entries every 24h
|
||||
ttl: 86400000, // 24h
|
||||
max: 1000
|
||||
})
|
||||
})
|
||||
)
|
||||
// init passport.js
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue