Affiliate plugin seems to use unnecessary sessions

The Affiliate plugin has a couple concerning aspects about it which break our sites ability to use a Varnish cache.

It writes to a SESSION variable, but it is then never used; furthermore, no session_start() call is ever made to begin with, so it all seems like dead code.

At the very least, if no affiliate is provided, the affiliate cookie should not be set.

  • Paul

    Greetings @Liberty.Me,

    It writes to a SESSION variable, but it is then never used; furthermore, no session_start() call is ever made to begin with, so it all seems like dead code.

    How are you deterring that the Affiliate plugin uses sessions? There is no session logic within the plugin. It uses cookies. We use the term 'session' in some of the labels but they should not be assumed to be PHP sessions.

    At the very least, if no affiliate is provided, the affiliate cookie should not be set.

    Well to be clear the Affiliate cookie is not set. There is a different cookie. What we call the 'NOCOOKIE'. This is designed to save on server processing. Basically on each page load the plugin tries to parse the URL to determine if it contains the affiliate reference. This 'NOCOOKIE' is checked to save on the process.

    And you can turn this off. Just add the following to your wp-config.php

    define('AFFILIATE_SETNOCOOKIE', 'no');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.