5/30/2023 0 Comments Cara setting clean url phpImagine if you had to type your username and password on every page that displayed your profile information! Yes, it would be cumbersome and not practical at all, and that's where sessions come into the picture.Ī session allows you to share information across different pages of a single site or app-thus it helps maintain state. In this model, if you wanted to display user-specific information, you'd have to authenticate a user in each request. The following diagram depicts the HTTP protocol in a nutshell. There's no way for the server to know that each request originated from the same user. So when you access other pages of the same website, the web server interprets each and every request separately, as if they were unrelated to one another. For example, when you access a web page, the server is just responsible for providing the contents of the requested page. ![]() The HTTP protocol is a stateless protocol, which means that there's no way a server can remember a specific user between multiple requests. Are you wondering why sessions are needed for a website? To see why sessions are necessary, we have to go back and see how the HTTP protocol is designed to work. ![]() A session is a mechanism to persist information across different web pages to identify users as they navigate a site or app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |