English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

wonder WWGS (what would Google say)

Send is always a good reference on matters PHP
mind you the PHP.NET is pretty good also

in essence a PHP session allows you to store infromation (either on the client or server, that allow you to carry informtion between ph pages. it allowsw you to circumvent the stateless nature of tradional web applications.

2006-09-16 10:42:47 · answer #1 · answered by Mark J 7 · 0 0

Sessions are a way to keep user-specific variables on hand for the life of the session (several page fetches over the course of time), without sending the actual data to the user.

When you start a session, a unique cookie is created and passed to the user's browser, and storage is set aside on your server to hold the variables. Each time the user gets a page, the session cookie is sent back to you so that you can use it to fetch the stored variables. You can change the length of time the session is good for so that a visitor who leaves your site is forgotten after a time, or remembered when he comes back.

A hypothetical example for this would be a case where you wanted to keep a logged-in user's nickname and permissions on hand while he surfed your site, without the need to look him up every time he read a page. The user would be essentially logged out if he did not read another page within the time limit you set because the session cookie is no longer valid.

2006-09-16 11:47:56 · answer #2 · answered by G. Whilikers 7 · 0 0

Sessions allow to store state-specific data between HTTP requests. Originally, HTTP was designed stateless; there was no way to tell who requests a document from the server. Eventually, sessions were introduced to help in authentication and tracking.

As to how sessions work in PHP, you should read the documentation:

http://www.php.net/manual/en/ref.session.php

___________

2006-09-16 12:21:40 · answer #3 · answered by NC 7 · 0 0

They allow storage on the server of information related to a particular user, kept across multiple page requests. the php website has a good tutorial and reference manual.

2006-09-16 10:36:27 · answer #4 · answered by Ken H 4 · 0 0

fedest.com, questions and answers