Pass the Session with Node.JS

1

Hi, I have a difficulty with the session in an application with nodejs and angular 4.

I'm doing it this way:

When you type the email and password in the login screen and give submit in the login form, create an http request, which is type an ajax, it passes the fields by POST method. Node takes this request, uses the fuction login of mongoose that is in the controller users, if the login is valid it inserts a boolean saying that this session exists (call of exist), id, name and surname in the session of the request. >

In the dashboard a getSession is done, which is nothing more than to get the session attribute that was saved in the login.

So far so good, the name of the person appears, because on the dashboard screen says "Hello, name of Person", but when I give F5 to update the page add the person's name, I'm having trouble identifying why the name of the person, can it be a problem in mongo or session?

    
asked by anonymous 27.09.2017 / 19:37

0 answers