PHP Scripts for Cookie and Session Management
HTTP Cookie, otherwise also known as browser cookie or cookie, is a small text file stored in the browser of a user's computer. The cookie is sent by the web server to the browser when a user is connecting to it and set in the browser such as Firefox or Internet Explorer. The cookie is used to store information such as user preferences, php session information etc and used by the web server everytime the browser connects to the web server. For example: a user might add few items to the shopping cart but leave the website without checking out. A cookie could then be set on the user's browser with the shopping cart content and next time when the user connects to the website, the cookie stored on his system is retrieved and shopping cart is populated with his previously added items.
PHP Session Management - A cookie can be used to store the session information of a user in his browser but not recommended as the cookie could be manipulated in the browser.
- Using Cookies with PHP - A simple PHP tutorial to help you understand how to set cookie in PHP and its expiration date and time.
- PHP Cookie Manual - The official PHP manual on cookies has good examples that you can use in your web applications right away.
- PHP Session Manual - The official PHP session manual page has everythying you need to know about session management, right from introduction to PHP session functions.
- PHP Session Tutorial - A brief and simple to understand PHP session example by Tizag will help you get started with session right away.
- Managing Users with PHP Sessions and MySQL - An excellent sitepoint article that shows you how to manage users of your website with PHP sessions and MySQL.
- Cookie and Session management using PHP - An O'reilly's article on cookie and session management using PHP.