Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added $_COOKIE to RequestSet environment #11771

Merged
merged 16 commits into from Nov 8, 2017

Conversation

MichaelRoosz
Copy link
Contributor

Added $_COOKIE to RequestSet environment.

Plugins like "plugin-QueuedTracking" need this change, because they process requests asynchronously (not with the same PHP context).

See matomo-org/plugin-QueuedTracking#51

@MichaelRoosz
Copy link
Contributor Author

Travis CI failes because of the setEnvironment() calls in the tests for "plugin-QueuedTracking". These errors will be fixed with another pull request for "plugin-QueuedTracking". I will link it here, once it exists.

@mattab
Copy link
Member

mattab commented Jun 14, 2017

Hi @MichaelHeerklotz
Thank you for your pull request! We're glad you are contributing to Piwik. Do you know when you will be creating the PR in QueuedTracking plugin? Looking forward to the other PR and reviewing them both. Cheers

@mattab mattab added the Needs Review PRs that need a code review label Jun 14, 2017
@@ -244,12 +244,14 @@ public function restoreEnvironment()
private function resetEnvironment($env)
{
$_SERVER = $env['server'];
$_COOKIE = $env['cookie'];
Copy link
Member

@tsteur tsteur Jun 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably add a check if (isset($env['cookie'])) {} just in case it is not set for possibly still queued entries that do not have the cookie set yet. and if not set, would empty cookie to $_COOKIE to not accidentally apply the cookie of someone else in case it is sometimes set, and sometimes not (which could happen for a short time of period)

@MichaelRoosz
Copy link
Contributor Author

MichaelRoosz commented Jun 19, 2017

Thank you for your feedback!
It took a bit longer than expected, because in order to update the tests, I also had to modify piwik-php-tracker. But the patches should be ready in one or two days now.

@mattab
Copy link
Member

mattab commented Aug 3, 2017

Hi @MichaelHeerklotz
Do you think you'll have a chance to submit the updated patch? Thanks

@mattab mattab modified the milestone: 3.1.0 Aug 3, 2017
@MichaelRoosz
Copy link
Contributor Author

Helllo @mattab patch is now updated, and I also updated the related tests.

@MichaelRoosz
Copy link
Contributor Author

@tsteur
Copy link
Member

tsteur commented Nov 8, 2017

👍

This will fix matomo-org/plugin-QueuedTracking#51

@tsteur tsteur merged commit 70b3314 into matomo-org:3.x-dev Nov 8, 2017
@mattab mattab modified the milestones: 3.3.0, 3.2.1 Nov 20, 2017
@matomo-org matomo-org deleted a comment from MatomoForumBot Dec 4, 2017
@MichaelRoosz MichaelRoosz deleted the add_cookie_to_env branch October 29, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants