Sunday, 1 February 2015

Update & Delete Cookies

If want to update & delete single cookie we can use the below methods ref from previous example

http://php-guidelines.blogspot.com/2015/02/cookies.html:


Delete Cookie :

setcookie("your_user", "", time() - 3600);


Update Cookie:

if user want to update cookie then set again cookie using setcookie method example:

$cookie_name = "your_user";
$cookie_value = "new value";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30)); // 86400 = 1 day

No comments: