This page defines some restrictions for cookies which should help reduce the chance that attackers can get useful information from user's browsers.
No confidential or sensitive information may be stored in a cookie.
Use DOMAIN and PATH attributes to restrict cookie access.
Use the HTTPOnly attribute to increase security of Internet Explorer and other browsers in the future - Indicates that the cookie can only be sent to the server that it originated from. Set this value to true so the cookie can only be sent to the server it originated from.
Syntax of PHP setcookie function:
The domain should be set to name of the domain it will be used on.
The "secure" flag is used to set the cookie to force the cookie to be sent only when it is encrypted using the HTTPS protocol.
The "httponly" flag is used to prevent scripting languages from accessing the cookie. This increases security since the scripting language cannot send the cooker to an attacker.
This example will require the cookie to only be sent from the server it originated from, but does not require that the cookie be sent over HTTPS.