未定义具有多个路由的快速会话问题

时间:2017-11-27 12:20:00

标签: node.js reactjs express-session

我正在使用此库在reactjs中创建新的shopify应用程序。 https://github.com/fullstackreact/food-lookup-demo

但是当我尝试使用session时,它不能使用多个路由,例如:

req.session.shop = 'yshop'; set in shopify file and when I am trying to get 
console.log(req.session.shop); in another routes file its showing undefined.

server.js代码:

app.set('trust proxy', 1) // trust first proxy
app.use(session({
  secret: "fd34s@!@dfa453f3DF#$D&W",
  resave: true,
  saveUninitialized: true,
  proxy: true,
  cookie: { secure: true, maxAge: 60000 }
}));

它没有用,有人帮帮我吗?

0 个答案:

没有答案
相关问题