Reputation: 41
Iam developing Angular4 login app. I want to store session in Redis. iam using Express session.
But I am getting the below error:
req.session.id = userName;
^
TypeError: Cannot set property 'id' of undefined
Upvotes: 0
Views: 4663
Reputation: 222582
You need to declare session first
req.session = {};
req.session.id = userName;
Upvotes: 1