Post by letxobnav » Thu Sep 17, 2020 11:28 pm

oc always loads the default framework.php

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by LocalExamination » Fri Sep 18, 2020 12:50 am

ADD Creative wrote:
Thu Sep 17, 2020 10:08 pm
Have you refreshed your modifications?
Yes of course.

letxobnav wrote:
Thu Sep 17, 2020 11:28 pm
oc always loads the default framework.php
Seems so, it is one file that can't be ocmodified. It applies changes, but never loads the modified version.

The only solution is to hard code it and wait for an official fix.

Thanks anyway.


Posts

Joined
Fri Feb 08, 2019 3:09 am

Post by ADD Creative » Fri Sep 18, 2020 1:31 am

LocalExamination wrote:
Fri Sep 18, 2020 12:50 am
ADD Creative wrote:
Thu Sep 17, 2020 10:08 pm
Have you refreshed your modifications?
Yes of course.
Sorry, I misunderstood your post. I thought you had made the changes to the core files. If you didn't want to change the core files you could try to modify the Set-Cookie headers with your web server. A quick web search should give you a few examples.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by stavrosa » Thu Nov 05, 2020 2:11 am

Solved, for me too!
ADD Creative wrote:
Sat Aug 22, 2020 9:48 pm
For PHP 7.3, try.

In catalog/controller/startup/session.php change.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
In system/framework.php change.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
For the language and currency cookies, they should be the same as in this post.
viewtopic.php?f=190&t=216579&start=20#p796020

Newbie

Posts

Joined
Wed Sep 23, 2015 8:08 pm

Post by webdesires » Tue Nov 17, 2020 9:18 am

We have released a plugin that handles all this for you - Secure Cookies & Sessions (with Strict, Lax, None samesite)

Regards, WebDesires.
We are a team of developers in the UK - professional and friendly, message us or give us a call anytime and we will be happy to help.

Phone: +44 (0) 121 318 6336 - Web: webdesires.co.uk - Skype: WebDesires
OpenCart Support - OpenCart Web Development - Our OpenCart Plugins


User avatar
Active Member

Posts

Joined
Mon Sep 28, 2015 6:34 pm
Location - West Midlands, United Kingdom

Post by wegabt » Sun Dec 13, 2020 8:28 am

I am using opencart 3.0.6. The problem still continues. Anyone can solve it?

Newbie

Posts

Joined
Sun Dec 13, 2020 8:25 am

Post by ADD Creative » Sun Dec 13, 2020 10:51 pm

wegabt wrote:
Sun Dec 13, 2020 8:28 am
I am using opencart 3.0.6. The problem still continues. Anyone can solve it?
You will have to give more information. Actual OpenCart version (there isn't a 3.0.6). PHP version. Link to your site. What you have tried so far.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by wegabt » Sun Dec 13, 2020 11:09 pm

version 3.0.3.6 www.silyver.com

Newbie

Posts

Joined
Sun Dec 13, 2020 8:25 am

Post by ADD Creative » Sun Dec 13, 2020 11:23 pm

wegabt wrote:
Sun Dec 13, 2020 11:09 pm
version 3.0.3.6 www.silyver.com
Your session cookie looks correct.

Code: Select all

set-cookie: OCSESSID=xxx; path=/; secure; HttpOnly; SameSite=None
You will need to describe your issues in more detail.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Ctsimpos » Fri Oct 29, 2021 5:23 pm

ADD Creative wrote:
Sat Aug 22, 2020 9:48 pm
For PHP 7.3, try.

In catalog/controller/startup/session.php change.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
In system/framework.php change.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
For the language and currency cookies, they should be the same as in this post.
viewtopic.php?f=190&t=216579&start=20#p796020
This works assuming changes to framework are done on core file.
HOWEVER the link for currency and language only refers to 2.3 OC and it does NOT work on OC 3

does anyone have a solution for language and currency for OC 3 and php 7.3?

many thanks

New member

Posts

Joined
Fri Aug 12, 2016 6:00 pm


Post by ADD Creative » Fri Oct 29, 2021 6:30 pm

Not that the language and currency cookies should be an issue, but if you did want to change them, in catalog/controller/startup/startup.php.
Change.

Code: Select all

setcookie('language', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
To.

Code: Select all

setcookie('language', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => $this->request->server['HTTP_HOST'], 'samesite' => 'None', 'secure' => true]);
Change.

Code: Select all

setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
To.

Code: Select all

setcookie('currency', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => $this->request->server['HTTP_HOST'], 'samesite' => 'None', 'secure' => true]);

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Fri Aug 09, 2024 5:13 am

ADD Creative wrote:
Fri Oct 29, 2021 6:30 pm
Not that the language and currency cookies should be an issue, but if you did want to change them.
This is the modification method you provided, But it is no longer available in OpenCart 3.0.4.0:

For PHP 7.3, try.

In catalog/controller/startup/session.php change.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($this->config->get('session_name'), $this->session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
In system/framework.php change.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
To.

Code: Select all

setcookie($config->get('session_name'), $session->getId(), ['expires' => ini_get('session.cookie_lifetime'), 'path' => ini_get('session.cookie_path'), 'domain' => ini_get('session.cookie_domain'), 'samesite' => 'None', 'secure' => true, 'httponly' => true]);
in catalog/controller/startup/startup.php.
Change.

Code: Select all

setcookie('language', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
To.

Code: Select all

setcookie('language', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => $this->request->server['HTTP_HOST'], 'samesite' => 'None', 'secure' => true]);
Change.

Code: Select all

setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
To.

Code: Select all

setcookie('currency', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => $this->request->server['HTTP_HOST'], 'samesite' => 'None', 'secure' => true]);
Old:
setcookie('language', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
OpenCart 3.0.4.0
setcookie('language', $code, time() + 60 * 60 * 24 * 30, '/');
Old:
setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
OpenCart 3.0.4.0
setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/');
The red code has been removed, So the original code cannot be used again, How can I modify the code to solve this problem?

Can you help me?

Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Fri Aug 09, 2024 4:02 pm

HAO wrote:
Fri Aug 09, 2024 5:13 am
The red code has been removed, So the original code cannot be used again, How can I modify the code to solve this problem?

Can you help me?

Thank you!
Change.

Code: Select all

setcookie('language', $code, time() + 60 * 60 * 24 * 30, '/');
To.

Code: Select all

setcookie('language', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'samesite' => 'None', 'secure' => true]);
Change.

Code: Select all

setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/');
To.

Code: Select all

setcookie('currency', $code, ['expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'samesite' => 'None', 'secure' => true]);

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Fri Aug 09, 2024 5:11 pm

Thank you for your help! ;D

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: Baidu [Spider] and 44 guests