Page 168 - Open Soource Technologies 304.indd
P. 168
Sarabjit Kumar, Lovely Professional University Unit 10: Cookies
Unit 10: Cookies Notes
CONTENTS
Objectives
Introduction
10.1 Cookies
10.2 Setting Cookies
10.3 Deleting Cookies with PHP
10.4 Session Function Overview
10.4.1 Starting Session
10.4.2 Working with Session Variables
10.5 Destroying Session and Unsetting Variables
10.6 Summary
10.7 Keywords
10.8 Self Assessment Questions
10.9 Review Questions
10.10 Further Reading
Objectives
After studying this unit, you will be able to:
• Explain cookies.
• Discuss setting cookies.
• Discuss cookies with PHP.
• Understand session function overview.
• Explain destroying session and unsetting variables.
Introduction
A cookie is an information that a Web site puts on your hard disk so that it can remember
something about you at a later time. (More technically, it is an information for future use that
is stored by the server on the client side of a client/server communication.) Typically, a cookie
records your preferences when using a particular site. Using the Web’s Hypertext Transfer
Protocol (HTTP), each request for a Web page is independent of all other requests. For this
reason, the Web page server has no memory of what pages it has sent to a user previously or
LOVELY PROFESSIONAL UNIVERSITY 163