我已经设置了密钥,但是得到了错误。这是在bitbucket管道上运行node / express应用程序时。我使用clientSession。
Error: cannot set up sessions without a secret or encryptionKey/signatureKey pair
at clientSessionFactory (/opt/atlassian/pipelines/agent/build/node_modules/client-sessions/lib/client-sessions.js:548:11)
at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/app.js:55:3)
我的appjs已经有秘密了:
app.use(
session({
cookieName: 'session',
secret: 'dfdjfodrgjfoggorgjrjdkfdskfhkdsfirsds',
duration: 0.5 * 60 * 60 * 1000,
activeDuration: 5 * 60 * 1000,
})
)