silexlabs / Silex

Silex is an online tool for visually creating static sites with dynamic data. With the free/libre spirit of internet, together.
https://www.silex.me
GNU Affero General Public License v3.0
2.26k stars 581 forks source link

SessionId undefinde #816

Open jotakar opened 6 years ago

jotakar commented 6 years ago

Hello In PublishRouter.js I see this code

router.post('/tasks/:task', (req, res, next) => 

{    switch(req.params.task) {      
    case 'publish':
        PublishJob.create(req.session.sessionID, req.body, unifile, req.session, req.cookies, req.protocol + '://' + req.get('host'));
        res.end();
       break;
      default:
        res.status(400).send({
          message: 'Silex task "' + req.params.task + '" does not exist'
        });
    }
  });

I see req.session.sessionID, but req.session doesn't have this property. I underrstand this id is for different templates edited from the same browser, like is explained in Publish.js. Then I wonder if I could set a value to this property, a value based in time for instance.

JbIPS commented 6 years ago

Hello,

From what I recall, the sessionID is set by Express when a user first connect to Silex.

I don't know how it is generated but it is supposed to guarantee unicity.

What is your purpose exactly?