php shopping cart
free shopping cart   shopping cart software

Free Shopping Cart PHP Software


Back to Functions List
This Function Has Been Available Since:
(AFCommerce v 2.1,     Functions v 1.1)


string = afc_get_domain_name_for_cookie ()

This function returns the domain name of your website in a format for setting a cookie. When setting a cookie, the domain name should be only a second level domain (sld), i.e. afcommerce, and a third level domain (tld), i.e .com. The cookie domain also has another period added to the beginning of it so that the cookie value will be available on all sub domains of your website. This function may be called directly inside the "setcookie" php function to avoid unnecessary coding, and will always figure out which domain name your website is using by checking the SERVER super global array variable.


There are no parameters for this function.

Return Values

Returns the domain name formatted for setting a cookie.

Open Source: Yes

Paul's Examples

setcookie("cookiename", "1", time()+3600, "/", afc_get_domain_name_for_cookie (), 0);

Back to Functions List


There are currently no posts for this topic.

AFCommerce Documentation

High End Website DevelopmentCompletely Free
Dating Service
Copyright 2004 - 2006
AFCommerce Website
And Cart Builder