Therefore, no matter whether you are completely new to Web development or are
a grizzled veteran hailing from another language, you should take time to carefully
read this chapter.
Available since the version 4.0 release, PHP??™s session-handling capabilities remain
one of the coolest and most discussed features. In this chapter you??™ll learn all about
the feature, including:
??? Why session handling is necessary, and useful
??? How to configure PHP to most effectively use the feature
??? How to create and destroy sessions, and manage session variables
??? Why you might consider managing session data in a database, and how to do it
What Is Session Handling?
The Hypertext Transfer Protocol (HTTP) defines the rules used to transfer text, graphics,
video, and all other data via the World Wide Web. It is a stateless protocol, meaning
that each request is processed without any knowledge of any prior or future requests.
Although HTTP??™s simplicity is a significant contributor to its ubiquity, its stateless
nature has long been a problem for developers who wish to create complex Web-based
applications that must be able to adjust to user-specific behavior and preferences.
446 CHAPTER 18 ?– SESSION HANDLERS
To remedy this problem, the practice of storing bits of information on the client??™s
machine, in what are commonly called cookies, quickly gained acceptance, offering
some relief to this conundrum.
Pages:
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523