'NodeJS/ExpressJS: res.locals vs. session
I'm working with NodeJS/Express JS and have trouble understanding the difference between res.locals & sessions. So you use sessions for say authentication and input validation of forms. You use res.locals also for authentication and it's general purpose is that it holds data, that is always accessible in all views.
I thought sessions are also always accessible in all views.
Can someone explain the difference?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
