J
J
JIakki2015-09-10 12:43:09
JavaScript
JIakki, 2015-09-10 12:43:09

How to make res.locals different for each client?

When authorizing, I do this
res.locals.data = req.user.data;
. But when another user logs in, then the data of the new user is in res.locals.data, and all users see this data instead of their own
. How can I fix this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Wolf, 2015-09-10
@mannaro

The question is not clear. Rephrase.

K
Konstantin Kitmanov, 2015-09-10
@k12th

It can not be. res.locals and locals, which lives only within a single request - moreover, res and req live only until the response leaves the client. Do you have some kind of global variable?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question