Documentation You are here: start » v » 1.1 » javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:1.1:javascript [2015/02/18 17:57] – [''cookiepath'': The Path on Which Your Visitor's FoxyCart Cookies Are Set] foxybrettv:1.1:javascript [2017/04/26 07:02] (current) – external edit 127.0.0.1
Line 51: Line 51:
   - <wrap tip>The ''www'' subdomain is effectively ignored</wrap>, so if you //do// want to lock your sessions down to ''.www.example.com'' you'll need to set the ''sitedomain'' value to something like ''www1.example.com''. The actual value doesn't matter; it's only counting the dots in the value after it strips the ''www''.   - <wrap tip>The ''www'' subdomain is effectively ignored</wrap>, so if you //do// want to lock your sessions down to ''.www.example.com'' you'll need to set the ''sitedomain'' value to something like ''www1.example.com''. The actual value doesn't matter; it's only counting the dots in the value after it strips the ''www''.
   - <wrap important>You //cannot// have the FoxyCart javascript at any other subdomains</wrap> if you are isolating by subdomain. For example, if you have two separate stores at ''products.example.com'' and ''donations.example.com'' you //cannot// also have your ''foxycart.js'' at ''www.example.com'' or ''example.com'', as that will set the session cookie at ''.example.com'', which will override the ''products'' and ''donations'' session cookies.   - <wrap important>You //cannot// have the FoxyCart javascript at any other subdomains</wrap> if you are isolating by subdomain. For example, if you have two separate stores at ''products.example.com'' and ''donations.example.com'' you //cannot// also have your ''foxycart.js'' at ''www.example.com'' or ''example.com'', as that will set the session cookie at ''.example.com'', which will override the ''products'' and ''donations'' session cookies.
 +
 +**Example:** If you're testing two different sites at subdomains of the same domain (like ''store1.example.com'' and ''store2.example.com''), you'd put this script tag before the FoxyCart script tag:
 +<code html>
 +<script type="text/javascript" charset="utf-8">
 + var sitedomain = 'store1.example.com';
 +</script>
 +</code>
 +<wrap tip>**Note:** You probably wouldn't want to keep this in production, unless the site //only// lives at a subdomain, and is never available at the ''example.com'' top level domain.</wrap>
 +
 +
 ==== ''cookiepath'': The Path on Which Your Visitor's FoxyCart Cookies Are Set ==== ==== ''cookiepath'': The Path on Which Your Visitor's FoxyCart Cookies Are Set ====
 The ''cookiepath'' determines the ''fcsid'' cookie's path. This is almost always going to be empty, so the cookies would be set at ''.example.com'', but if you do need to have multiple FoxyCart sessions on the same domain you could use this setting to restrict cookies to something like ''.example.com/en/'' and ''.example.com/es/'' (to split English and Spanish FoxyCart stores, for example). The ''cookiepath'' determines the ''fcsid'' cookie's path. This is almost always going to be empty, so the cookies would be set at ''.example.com'', but if you do need to have multiple FoxyCart sessions on the same domain you could use this setting to restrict cookies to something like ''.example.com/en/'' and ''.example.com/es/'' (to split English and Spanish FoxyCart stores, for example).

Site Tools