Skip to content

Commit

Permalink
Update setcookie with domain path
Browse files Browse the repository at this point in the history
  • Loading branch information
dmensinger committed Dec 23, 2021
1 parent 2688632 commit 2d182ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Add `?utm_catcher_params` to any link `href` URL and the plugin will replace it

## Changelog

### 1.1.2
* Update setcookie with domain path

### 1.1.1
* Adds check for empty cookie before setting PHP cookie. Could cause caching issues with nginx/Varnish.

Expand Down
6 changes: 3 additions & 3 deletions vital-utm-catcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Vital UTM Catcher
Plugin URI: https://vtldesign.com
Description: Simple UTM parameter processor
Version: 1.1.1
Version: 1.1.2
Author: Vital
Author URI: https://vtldesign.com
Text Domain: vital
Expand Down Expand Up @@ -85,7 +85,7 @@ class Vital_Utm_Catcher {
* @return void
*/
public function __construct() {
$this->_version = '1.1.1';
$this->_version = '1.1.2';
$this->assets_dir = plugin_dir_path(__FILE__);
$this->assets_url = plugin_dir_url(__FILE__);
$this->suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
Expand Down Expand Up @@ -143,7 +143,7 @@ public function catch() {
}

if ($cookie_value !== '') {
setcookie($field, $cookie_value, strtotime("+{$this->cookie_expires} seconds"), $domain);
setcookie($field, $cookie_value, strtotime("+{$this->cookie_expires} seconds"), '/', $domain);
$_COOKIE[$field] = $cookie_value;
}
}
Expand Down

0 comments on commit 2d182ad

Please sign in to comment.