Serverside:
http://www.w3schools.com/PHP/php_cookies.asp

Client-side:
http://www.w3schools.com/js/js_cookies.asp