For more information... RTFM!
NAVIGATION
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

SourceCookie

Specify a cookie to set for affiliates (source session variable).

Synopsis

SourceCookie name [expire [domain [path [secure]]]]

Scope

This directive is only available for use in the local (catalog.cfg) configuration file.  It will not affect any other website in any way.  This directive will not work in the global (interchange.cfg) configuration file. 

Availability

Availability

This directive was introduced in version 5.7.2, and is therefore not available for use with any earlier Interchange version.

Description

Parameter Description Default
name The name of the cookie you want to set. None
expire Cookie expiration date. None
domain Override the CookieDomain domain(s). See CookieDomain
path URI path(s) for the cookie. See Catalog
secure Cookie is only to be returned for secure pages. 0
autoreset Cookie is automatically reset on each page access. 0

This directive allows you to automatically set a cookie when a user enters the site via an affiliate (source).  Setting SourceCookie defines the relevant attributes of a cookie to be maintained in conjunction with the usual session-only parameter $Session->{source}.  Its usage eliminates the duration of the user's session as the limiting factor for applying credit to a referrer.

SourceCookie and SourcePriority would be expected to typically work in tandem, and thus the same cookie defined in both contexts.  However, there is no such requirement to do so.  Defining SourceCookie by itself merely makes the cookie available any time the core source routines set or manipulate $Session->{source}.  That cookie may, or may not, be used as an element in SourcePriority, which itself may look to a cookie not maintained by this SourceCookie directive.

Parameters

name

This is the name of the cookie.  The same name must be used when reading the cookie later, with SourcePriority, or whatever.

expire

Session cookies are only valid during a browser session, and are automatically rendered invalid (usually deleted) as soon as the user closes the browser.

Persistent cookies outlive browser sessions, but cannot live forever.  If you want your cookie to be persistent then you must specify an expiration date.  You may set a persistent cookie's expiration date using either of the following two methods:

Absolute date/time

You may specify any future date/time using the following format:

Wdy, DD-Mon-YYYY HH:MM:SS GMT
Note

Note

The timezone must be GMT.  The British invented time.  Accept it and move on.  :-)

Relative date/time offset

You may specify an expiration date/time in terms of an offset from the current date and time.  The date must take the form of a number, followed by one of "seconds", "minutes", "hours", "days" or "weeks".  For example:  "7 days", " 4 weeks" or "60 minutes" etc.

domain

The (space separated) value(s) you specify, using this parameter, will override the default domain(s), listed using the CookieDomain local configuration directive.

You might want to set this if you need to access the cookie from outside of the Interchange-driven website, but it is usually better to use the CookieDomain directive instead.

The default is to use your website's domain or all of the values declared using the CookieDomain local configuration directive.

path

The (space separated) value(s) you specify, using this parameter, will override the default URI path(s) configured using the Catalog global configuration directive.

secure

When set true the cookie will have the secure flag set.  This instructs the browser to only send the cookie with requests for secure (HTTPS/SSL) pages.

autoreset

autoreset is a boolean that, when set true, will cause each request from the client to reset the cookie in the response, effectively refreshing the expiration time relative to the current time.  Uses, for example, might include a desire to ensure that the source cookie last "forever" (autoreset + sufficiently long expire period) or for more obscure uses such as "Affiliate should last [value of expire] from the last request."

Category:  Local config directives
Last modified by: Peter Ajamian
Modification date: Sunday 24 May 2009 at 6:53 AM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Contact us