Creating cookies available to different servers

I recently ran into a situation where i had to define certain variables and make their data available to apps on different servers. The way i went about in doing this is to create a cookie available to that certain domain. I used the "domain" attribute in the cfcookie tag.

<cfcookie name="appName.IsLoggedIn" value="True" domain=".dcfusion.com">

Some things to remember are that you must start with a period. If the value is a subdomain, the valid domain is all domain names that end with this string. This attribute sets the available subdomains on the site upon which the cookie can be used.

For a domain value that ends in a country code, the specification must contain at least three periods; for example, ".mongo.state.us". For top-level domains, two periods are required; for example, ".mgm.com".

You cannot use an IP address as a domain.

No comments yet.

(will not be published)
Leave this field empty: