Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Possible conflict between ob_start() and a 3rd party script?  (Read 3015 times)

0 Members and 1 Guest are viewing this topic.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page

The recent local implementation of the cookie law requests the website owner to block 3rd party cookies (social network buttons, Analytics, AdSense, Disqus) *until* the user has expressed its consent.
I chose a js+php script ( https://github.com/diegolamonica/EUCookieLaw ) that works good with all parts of my website, WP included, but with CPG: I noticed that the script doesn't actually block cookies, with no apparent error noted in Firebug console.
However, it can still read a previously set cookie, called __eucookielaw, and the cookie notice banner won't pop-up, if the user has already expressed its consent in another part of the website.

I wonder if this is due to the fact that CPG uses:
Code: [Select]
ob_start();in cpg_get_custom_include(), which I need to include a custom header in CPG.

In fact, the cookie script (which must be included at the top of the header), also uses
Code: [Select]
ob_start("euCookieLaw_callback");
From the official documentation:
Quote
The server-side script intercept the output buffer and will remove the sent cookies when user has not yet approved the agreement.

Then you should include the file eucookielaw-header.php as the first operation on your server. This will ensure you that any of your script or CMS like Wordpress, Drupal, Joomla or whatever you are using, is able to write a cookie if the user doesn't given his consensus.

Direct link to the source code:
JS: https://github.com/diegolamonica/EUCookieLaw/blob/master/EUCookieLaw.js
PHP: https://github.com/diegolamonica/EUCookieLaw/blob/master/eucookielaw-header.php
CSS: https://github.com/diegolamonica/EUCookieLaw/blob/master/eucookielaw.css

I'll appreciate any help.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Possible conflict between ob_start() and a 3rd party script?
« Reply #1 on: June 15, 2015, 10:26:02 am »

I haven't looked closer at the other script. Maybe this plugin solves your issue: http://forum.coppermine-gallery.net/index.php/topic,76197.0.html
Logged

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page
Re: Possible conflict between ob_start() and a 3rd party script?
« Reply #2 on: June 15, 2015, 10:31:37 am »

Thanks, I already took a look at that plugin a while ago, but it seems that it blocks cookies set by CPG (and its plugins), while the law requires to block also 3rd party cookies, wherever on the page may they be.

The developer of the plugin I'm using couldn't help me, because he doesn't use CPG.
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.