Recipe 8.3. Deleting Cookies8.3.1. ProblemYou want to 8.3.2. SolutionCall setcookie( ) Deleting a cookie
8.3.3. DiscussionIt's a good idea to make the expiration time a long time in the past, in case your server and the user's computer have unsynchronized clocks. For example, if your server thinks it's 3:06 P.M. and a user's computer thinks it's 3:02 P.M., a cookie with an expiration time of 3:05 P.M. isn't deleted by that user's computer even though the time is in the past for the server. The call to setcookie( ) that deletes a cookie has to have the same arguments (except for value and time) that the call to setcookie( ) that set the cookie did, so include the path, domain, and secure flag if necessary. 8.3.4. See AlsoRecipe 8.1 shows how to set cookies; Recipe 8.2 shows how to read cookie values; Recipe 8.12 explains output buffering; documentation on setcookie( ) at http://www.php.net/setcookie. |
Wednesday, December 30, 2009
Recipe 8.3. Deleting Cookies
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment