Page 1 of 1

Sign out automaticly after buying

Posted: Tue Apr 20, 2021 8:58 pm
by DANDTON
Hello everyone,
I am useing 3.0.3.2, today I found a problem, when I finish buying by paypal and click "return back" button on paypal page, then the page go to my store.
BUT, the buyer account sign out automaticly, I must login again. BUT when I login again, I can see the shopping cart is not clear......
I can see that: All my google chorme's cookies is sign out automaticly, my admin account in another lable is sign out automaticly too.....
I use Journal 3.1.8.
Thank you for your help!!
Yours, Daniel

Re: Sign out automaticly after buying

Posted: Tue Apr 20, 2021 9:04 pm
by straightlight
DANDTON wrote:
Tue Apr 20, 2021 8:58 pm
Hello everyone,
I am useing 3.0.3.2, today I found a problem, when I finish buying by paypal and click "return back" button on paypal page, then the page go to my store.
BUT, the buyer account sign out automaticly, I must login again. BUT when I login again, I can see the shopping cart is not clear......
I can see that: All my google chorme's cookies is sign out automaticly, my admin account in another lable is sign out automaticly too.....
I use Journal 3.1.8.
Thank you for your help!!
Yours, Daniel
Unsupported.

Re: Sign out automaticly after buying

Posted: Tue Apr 20, 2021 10:31 pm
by JNeuhoff
Not an OpenCart bug, the OpenCart checkout eventually reaches the checkout/success page, and the user stays logged in, but with the shopping cart cleared after the successfully processed order. Journal3 is a different framework (80% non-Opencart) so in your case you will have to get in touch with the Journal support.

Re: Sign out automaticly after buying

Posted: Tue Apr 20, 2021 10:48 pm
by DANDTON
JNeuhoff wrote:
Tue Apr 20, 2021 10:31 pm
Not an OpenCart bug, the OpenCart checkout eventually reaches the checkout/success page, and the user stays logged in, but with the shopping cart cleared after the successfully processed order. Journal3 is a different framework (80% non-Opencart) so in your case you will have to get in touch with the Journal support.
Thank you very much! I did more test and find the problem seems come from Paypal, I use Paypal standard as payment way. I have paypal standard and Free check out 2 way. When I test by free check out, there is no problem, but when I use paypal stanard and test by sandbox account, I found this problem comes out,
For insurance, I tried to use my another V1.5.6 opencart and V3.0.2 opencart website, this problem is still there when i use paypal standard.
So I doubt it is the problem from paypal, I will call them tomorrow and let you know more info.

Re: Sign out automaticly after buying

Posted: Thu Apr 22, 2021 11:25 am
by DANDTON
Called paypal, and got no answer, so I tried to test more and find the resolution: O0
1.Must update PHP7.0 to PHP7.3, after test, only PHP7.3 is ok
2.edit document: /upload/system/framework.php around 110 line

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

//modified cookie
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]);

3.edit document: /upload/catalog/controller/startup/session.php around 25 line
//original cookie
//setcookie($this->config->get('session_name'), $this->session->getId(), ini_get('session.cookie_lifetime'), ini_get('session.cookie_path'), ini_get('session.cookie_domain'));

//modified cookie
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]);

refresh ocmod, done,
Now test, after checkout and return back to sucessul pay page, the customer won't logout and the shopping cart is empty.