Jump to content

Cookie Compliance Dialogue


Robo

Recommended Posts

the cooky dialog is on top of the screen you can not click it away it stays there and the link  in the coocky dialog does not work try it 

i have no foundation skin used 

btw i only did the upgrade and that worked fine , on some 404 s but that was solved quick  and before the upgrade it worked all ok 

Link to comment
Share on other sites

Two things to change: core code, and a skin template.

The core code:

In /classes/session.class.php, near line 583, find the public function set_cookie().

Find:
        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);

Change to:
        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }

I have submitted an issue in the Github.

The skin template:

Skins built for CC5 has a backwards incompatibility for a language string that was updated in CC6. CC6 provides a properly derived phrase. The template main.php, near the bottom:

Find:
    <p>{$LANG.notification.cookie_dialogue|replace:'%s':{$CONFIG.store_name}}</p>

Change to:
    <p>{$COOKIE_DIALOGUE_TEXT}</p>

 

Link to comment
Share on other sites

the core changing did not work,  it all quit error 500 does not laod anything

skin change .. now it loads the privacy document when clikking the link in the cooky banner

error report 

[<strong>Exception</strong>] /home/u68474p65147/domains/rbckits.com/public_html/shop/classes/session.class.php:611 - syntax error, unexpected 'private' (T_PRIVATE)

Link to comment
Share on other sites

What statement is on line 611 of /classes/session.class.php?

 

This what that area of session.class.php should look like after the edit. Make sure there are no missing curly braces.

              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }
    }

    //=====[ Private ]=======================================

    /**
     * Close a session
     *
     * @return true
     */
    private function _close()

 

Link to comment
Share on other sites

wel replaced 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);
    }
with 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }

 

and it did not work 

Link to comment
Share on other sites

What you should be replacing is just two lines. Do NOT include the third line you have shown above (the closing curly brace).

Find:
        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);
Link to comment
Share on other sites

we did exactly as given

In /classes/session.class.php, near line 583, find the public function set_cookie().

Find:
        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);

Change to:
        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }

 

please what ? should be replaced with what ?, as i do not understand , as this was posted by you and it is not clear for me , thanks anyway

Link to comment
Share on other sites

These two lines of code:

        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);

should be replaced by these 13 lines of code:

        $same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }

 

Link to comment
Share on other sites

again it does not work , in the admin site we get a 500 error all blank 

 

what we did 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value, 'expires='.$expire.';path='.$params['path'].';domain='.$params['domain'].';secure='.$params['secure'].';httponly='.$params['httponly'].';'.$same_site);
    }

replaced with 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }
 

Link to comment
Share on other sites

You are selecting three lines to be replaced:

A line that starts with $same_site...
A line that starts with return...
A line that has a closing curly brace }

Do NOT select the line that has the curly brace. Select only the two lines given in the instructions. Replace only those two lines.

Link to comment
Share on other sites

maybe i am dumb 

so these 2 lines 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        return setcookie($name, $value,

 

replace with 

$same_site = CC_SSL ? 'samesite='.$params['samesite'] : '';
        if (PHP_VERSION_ID < 70300) {
            return setcookie($name, $value, $expire, $params['path']."; $samesite", $params['domain'], $params['secure'], $params['httponly']);
        } else {
            return setcookie($name, $value, [
              'expires' => $expire,
              'path' => $params['path'],
              'domain' => $params['domain'],
              'secure' => $params['secure'],
              'httponly' => $params['httponly'],
              'samesite' => (CC_SSL ? $params['samesite'] : ''),
            ]);
        }

is this correct or ?? i do not understand as this is exact what you wrote in previuos post 

Link to comment
Share on other sites

yes it worked

thanks a lot

btw i have a lot of errors after upgrading like these ones any thougths ?

File: [seo.class.php] Line: [726] "INSERT INTO `CubeCart_seo_urls` (`type`,`item_id`,`path`,`custom`) VALUES ('prod','','-p.html','0');" - Duplicate entry '-p.html' for key 'PRIMARY'

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...