-
Book Overview & Buying
-
Table Of Contents
PHP and MongoDB Web Development Beginner's Guide
Before we start building the session manager, let's get the basics of HTTP sessions right. So what is a session? By design, HTTP is stateless. You make a request to a web server, it replies to you with a response, and then it forgets about the request. It has no memory of what requests it served you earlier. But this stateless nature of HTTP goes against the notion of interactive web applications. These applications need to keep track of users' activities on the website. They need to know who the user is, if the user is allowed to see a webpage, where the user has been before coming to this page. On an e-commerce site, for example, the user has to follow a step-by-step (or page-by-page to be more precise) process to log out of his/her account. How does a web application running on top of a stateless protocol implement persistence of user state? The answer is a session. By definition, a session is a series of HTTP requests, performed consecutively by a user from...
Change the font size
Change margin width
Change background colour