PHP - Cookies

Cookies are bits of data that a web browser stores on your visitor's computer. They can be very useful if you need to store things like your visitor's preferences or login data or other things that are specific to a particular visitor. The following example of how to set cookies.

How to Set Cookies


<?php

	$date = time() + 60 ;
	setcookie( "login", "john", $date );

?>		
							

How to Delete Cookies


<?php

	$date = time() - 60 ;
	setcookie( "login", "john", $date, "/", "example.com" );

?>		
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!