小编hle*_*lev的帖子

如何使用heroku + node.js + express设置安全cookie?

我有一个在Cedar堆栈上运行的node.js应用程序,我很困惑为什么安全的cookie不起作用.

"express": "3.0.3",
"node": ">=0.8.14",

...
app.use(express.session({
        secret : 'somesecret',
        store : // store works fine, sessions are stored
        key : 'sid',
        cookie : {
            secure : true, // it works without the secure flag (cookie is set)
            proxy : true,  // tried using this as well, no difference
            maxAge: 5184000000 // 2 months
        }
}));
...
Run Code Online (Sandbox Code Playgroud)

在localhost上一切正常,但在heroku上我似乎无法设置安全cookie.我究竟做错了什么?该文档称,负载平衡器终止SSL,它说的是配置在那里?
非常感谢

cookies heroku node.js express

11
推荐指数
2
解决办法
6075
查看次数

标签 统计

cookies ×1

express ×1

heroku ×1

node.js ×1