A session is a hash that stores user data on a website. A good way to think of it is if you went to a quaint bed and breakfast called Sessions B&B. Sessions B& B is the ultimate bed and breakfast. They have plush beds, fabulous homemade meals, wine tasting, a beautiful view just the whole shebang. In this example, the registrar ledger is a hash for a website. The ledger keeps a record of all the guest that have stayed at the B&B. When you enter Sessions B&B you start you stay. Same thing with a web page. When you open facebook in a web browser you have started your session. When you log on to facebook with your user and password it is like signing your name Mr. & Mrs. Smith into the ledger. Then you are assigned a room # 10. Room #10 is would be your unique session id. When you first came to the Sessions B&B you were giving a card and filled out your information. Where you live, phone, email, maybe even your birthday so they can send you a birthday card with a discount. Web pages do the same. As soon as you check-out you have finished your stay at Sessions B&B they draw a line through your name and write a check out date. The same thing happens when you sign out of facebook your. Your session cookie has expired and finished.
You loved your stay at Sessions B&B that you come back next month. Since they have all your information down you don’t have to establish yourself as a new guest. The check-in process is must quicker for you. They even remember your favorite room is #10, you love blueberry pancakes for breakfast, and like early morning hikes. This would be referred to as persistent cookies on a web page. The website remembers your user input and preferences for a future site visit. There are numerous benefits having persistent cookies. You can automatically be logged in, authenticated, and quicker page loading time. Your experience is much more enjoyable when you don’t have to remember your login and fill in your information over and over.