Who (web server or developer) cares about maintaining a single HTTP session in a browser?

As we know, everything has one httpsession for each web browser, for example IE. If we run n number of requests from one browser, the web server / application server will support one httpsession for all requests. In my opinion, this is the default functionality for all web servers / appservers. Although it depends on the server how they implement it. they can do this by rewriting URLs or using cookies. Right? A betting developer should not talk about this. I think usually the server does this through cookies, but if cookies are manually disabled, the server might do this by rewriting the URL. Is it correct?

+2
source share
1 answer

This is the server that will support the sessions. And the server is responsible for session resolution. Customers do not have to worry about sending any information explicitly. Since the Client can send Cookies stored on the client with each request, the server can use Cookies to track sesssion.

Note. Cookies are just one way to implement session tracking. This is also the best way.

Thus, the server uses cookies as one of the ways to handle session tracking.

This can be done in other ways:

URL rewriting - the application / server should add a session identifier in all URLs / links. When they are called from the client, the session comes to the server along with the URL.

Hidden form fields . Forms may contain a hidden input type with a session identifier as the field value. When the form is submitted, the session identifier is followed by the form data.

+1
source

Source: https://habr.com/ru/post/1394113/


All Articles