Contents /
Previous /
Next
Cookies and Session Management
Using regular HTML pages, when a browser requests a page from a
server, the server will serve that page to the client then simply
forgets about it! No knowledge of the client is kept between
requests. Certainly the client browser will keep a record of the pages
in the History object, but unless we do something no other information
is kept. In a suite of web pages this means that if we enter
information in one form, it will not automatically be available to
other pages in the web application.
HTML and PHP offer
various methods to make a web viewing session "stateful":
- Query Strings:
Information can also be kept in the query string. The draw back of
this of course is that the information is visible.
-
Hidden Input elements:
Information can be passed from page to page using hidden form elements.
-
Cookies:
Cookies are strings that are stored on the clients computer which are
Domain specific.
-
Sessions:
PHP includes a sessions management system that allows to treat
any single session on a single client as a unified whole.
- Frames:
All the variables would be placed in one of the Frames using
JavaScript. These would then be available in any of the other
frames. This method is really only of Historical interest.