So this is what the server receives from our client-side in the cookie.
And the cookie itself contains all this information here.
And so, the server is recognizing that this is a valid user, and
then sends back the results from that server-side.
Going to postman,
let's again take a look at the details of what is inside the cookie.
So when you open the cookie here,
you again see all the details of the information inside the cookie here.
If you look at your editor, you now see that in your editor,
there is a new folder here called sessions that has been created here.
Now this is because we were using file store to
keep track of all of our sessions.
Now that's one of the reasons why I use the file store so that I can show you what
is stored in a session file on my server-side.
So if you open this file here with the long name there,
you would see inside there, the session information being stored here.
So if you browse this session information, note in particular,
this initial field that is in the server-side.
So this is where your server is tracking all this information on the server-side.
Now this cookie itself is recognized by the server,
since the client includes this cookie in the incoming request.
Now it is able to go into the sessions store and then retrieve the information,
and then load up this onto the req.sessions.
And hence, the req.session contains this particular information in there
which my server is using to cross-check to make sure that
my client is an authorized client.
That is it about sessions.
With this, we complete this exercise.
In this exercise,
we have seen how we can set up our express application to use sessions.
And we also saw how we are using the file store to keep track of our sessions.
This is a good time for you to do a GET comment with
the message express sessions part one.
[MUSIC]