Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Server/main.js Routes #1348

Open
carloquilala opened this issue Aug 7, 2018 · 0 comments
Open

Server/main.js Routes #1348

carloquilala opened this issue Aug 7, 2018 · 0 comments

Comments

@carloquilala
Copy link

carloquilala commented Aug 7, 2018

Can someone please enlighten me, I'm currently adding routes in my app, and I want to get the req.session to work also in production build but it returns null

Production using script "cross-env NODE_ENV=production pm2 start server/main.js --name ucf-www"

app.post('/api', bodyParser.json(), (req, res) => {
  const nodeSession = req.session;
  console.log(nodeSession)

  // undefined
})

Development using script "cross-env NODE_ENV=development babel-node build/scripts/start"

app.post('/api', bodyParser.json(), (req, res) => {
  const nodeSession = req.session;
  console.log(nodeSession)

  /*
    Session {
      cookie: {
        path: '/',
        _expires: null,
        originalMaxAge: null,
        httpOnly: true
      }
    }
   */
})

please delete, just forgot to use express-session in my production config

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant