WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Delete cookies
Categories : Cookies, PHP Update Picture
Alexei Selivanov
Date : Mar 01st 2002
Grade : 3 of 5 (graded 3 times)
Viewed : 51428
File : delete_cookies.txt
Images : No Images for this code example.
Search : More code by Alexei Selivanov
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Deleting cookies

You can not delete a cookie, but you can assign it a different value from what it
should be to permit some action.

The easiest way you can use this script is to link it to a "Log off" button or link:


<?
//Killing the cookie:
$cookie_name="myCookie";

//here we assign a "0" value to the cookie, i.e. disabling the cookie:
$cookie_value="";

//When deleting a cookie you should assure that the expiration date is in the past,
//to trigger the removal mechanism in your browser.
$cookie_expire=time()-60;

$cookie_domain="";
setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain,0);

//re-direct to login screen (or any other you like):
header( "Location:login.html");
exit;
?>





Simple Cookie example
Categories : PHP, Beginner Guides, Cookies
Smart Counter - This little script is a plain and simple hit counter that uses cookies to determine whether or not the visitor has already been counted.
Categories : Cookies, HTML and PHP, PHP
Cross Browser Session Starter
Categories : PHP, Sessions, Cookies
Authentication script to authenticate users in Active Directory through LDAP.
Categories : LDAP, Authentication, Cookies, PHP
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
PHP Cookies - Simple cookie write/read methods that allow basic encryption
Categories : PHP, Cookies, Security, Encryption
How to make sure a that $foo is from a cookie and not from the URI.
Categories : PHP, Variables, Global Variables, Cookies
Multilingual php webpage
Categories : PHP, Languages, Cookies
cookie
Categories : Cookies, PHP
Make old style (PHP3) scripts using GET, POST, COOKIE and File uploads (POST) compatible with PHP 4.2.0
Categories : PHP, HTML and PHP, Global Variables, Cookies, Variables
With this class you can use cookies with chips
Categories : PHP, Cookies
Function that allows a Javascript cookie to be set after HTML has been outputted to the page.
Categories : PHP, Java Script, Cookies, HTML and PHP
Function that does language negotiation based on the Accept-Language header, a cookie or host name
Categories : HTTP, PHP, Cookies
Example voting script. Lets people enter suggestions and vote for existing ones.
Categories : MySQL, PHP, Cookies, Complete Programs, Databases
Secure Login
Categories : PHP, MySQL, Cookies, Security