|
|
|
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;
?>
|
|
| PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication, Apache, Cookies, PHP, MySQL | | | A very simple PHP single password cookie based login without usernames. Categories : PHP, Cookies, Security, Beginner Guides | | | Authentication script to authenticate users in Active Directory through LDAP. Categories : LDAP, Authentication, Cookies, PHP | | | cookie Categories : Cookies, PHP | | | Example voting script. Lets people enter suggestions and vote for existing ones. Categories : MySQL, PHP, Cookies, Complete Programs, Databases | | | 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 | | | The Best Authorize Categories : PHP, MySQL, Cookies | | | Secure Login Categories : PHP, MySQL, Cookies, Security | | | Simple Cookie example Categories : PHP, Beginner Guides, Cookies | | | With this class you can use cookies with chips Categories : PHP, Cookies | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | How to make sure a that $foo is from a cookie and not from the URI. Categories : PHP, Variables, Global Variables, Cookies | | | Function that does language negotiation based on the Accept-Language header, a cookie or host name Categories : HTTP, PHP, Cookies | | | Cross Browser Session Starter Categories : PHP, Sessions, Cookies | | | Store, retrieve and delete cookies using JavaScript. Categories : Java Script, Cookies, Beginner Guides, Cookies | |
|
|
|