Hello, everyone. Welcome back. It
is pretty low. Section 2, will be taking a look at HTTP
protocol itself. And how are they different ways?
We can Implement sessions. And we'll also
take a deep dive how the super Network. Protocols also
work. So, now, let's take a look at HTTP
itself.
So we have all heard about a shield protocol. So
technically, this protocol is used when you
wanted to access any HTML documents which are
residing on a web server.
I wanted you to pieces all of us, all
of the end users. They use a browser in order to
access a website. So, when we talk about a website, it
contains many documents for resources as
we call it. So that could be your HTML document itself.
That's a Content, followed by CSS
files that are very useful. In order to decide
the layout J's files could be used for emissions or
validations and images and videos, depending on
the type of site where we setting
So, when a browser makes an HTTP protocol request, it
is trying to fetch all of those required resources,
so that then user can view it.
The browser will actually try to construct the document and
decide the layout based on the coding on the back end.
So this is how a typical should be works.
In the last section, we did take a look and understand
as to why is HTTP known as stateless. That
means the CTP cannot manage, which request
is sent by whom and so
on since it's a stateless protocol. It will actually work in isolation. So
in order for web server to actually analyze
which user is sending what type of request and
what is the exact type of content that has to be sent back? We
would try to maintain a session that is called a session persistence.
So typically,
Multiple ways, you know how certain
can be persisted and it is known
in different formats such as session, it session token and
a cookie.
In technology and implementation, they are a bit unique and
different, but let's for Simplicity. Let's say that all
three work in the same fashion.
So we did take a look at a similar scenario in the previous section
where a user is trying to send a request. The
request could be browsing a webpage, trying
to send a login credential or any other activity and
the server will respond back. So
it will also respond back with the unique token. So
this unique token is different for each
user's, and that is how it will try to identify
which user is seeking, which
request and what's all of this.
Hans has to be sent back.
So how does those over actually take a look
at the request open itself? Because once
the server responds to act with the initial token, then
original very request. The
potato Qin would be embedded and sent back to the server. That
is how the server is going to understand how
user a is different from user B. And what are
the different responses as that it has to
send back to each of the use of
So, we are trying to talk in terms of Technology,
agnostic. That means you're just trying
to understand how, what are the different types of mechanisms housing
can be persisted from the server point of view in
most of the cases. The data is stored in memory. So
that means the particular session is based on
the service that is running on the web server. So,
in case if the service is restarted, that means the
session tokens will be pushed.
And it has to be sent back for the user has to
log. In back again. One of the mechanism is
that all this ocean tokens are actually stored in a
database. This could be one, other implementation where
all the session IDs are stored and that
is how the server is going to uniquely identify
each of these requests.
Now quickly, let's take a simple example.
So I've just opened up the developer tool using EFT.
Well, this is a simple, local application that is running on my
local machine. So what I'm trying to do, is that
just going to log in using my credentials.
So what is really happening now, so
we can actually see that the unique token
has been sent back. So this particular value is
going to be assigned to the user Tom. So
let's try to browse the same. Your luck ain't in a new tab.
So, we can still see that. Even though we opened up normal
page initially. We did see a login speed, but
right now it again, welcome back
to use at home. This is just because of the reason because
the session is being positioned on the browser itself.
Now, if I just little session itself or
the cookie for in memories cookie, and
I'm just trying to refresh the page so we can see that since
the session was actually eliminated. So
the user was logged off. This
is one of the simple example, how session
is being persisted on the web server.
Now, the key bottom points that we learned is that the
request is actually stored. So that decision can be persisted in
order to identify different user and the
request and that isn't acquisition management. You
want to call it in terms of cookies session tokens or session IDs,
that's it for this video in the next
video. We'll be trying in-depth. Understand. What are
the different types session can be implemented and persisted. Thank
you.