Skip to content

Instantly share code, notes, and snippets.

@damianoporta
Created December 5, 2014 11:53
Show Gist options
  • Save damianoporta/c4f87b8d6ad7aef8455c to your computer and use it in GitHub Desktop.
Save damianoporta/c4f87b8d6ad7aef8455c to your computer and use it in GitHub Desktop.
<?php
if (!empty($this->request->query['tr']))
{
$this->Cookie->write('tr', $this->request->query['tr'], true, '30 day');
}
else
{
if ($this->Cookie->check('tr'))
{
$this->Cookie->write('tr', $this->Cookie->read('tr'), true, '30 day');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment